GVKun编程网logo

将 nesjs 应用程序连接到 SQL Server Express 时出错:无法连接到 localhost:1433 - 自签名证书

7

本文的目的是介绍将nesjs应用程序连接到SQLServerExpress时出错:无法连接到localhost:1433-自签名证书的详细情况,我们将通过专业的研究、有关数据的分析等多种方式,同时也不

本文的目的是介绍将 nesjs 应用程序连接到 SQL Server Express 时出错:无法连接到 localhost:1433 - 自签名证书的详细情况,我们将通过专业的研究、有关数据的分析等多种方式,同时也不会遗漏关于c# – 无法从Visual Studio 2012连接到SQL Server Express 2014、centos – 无法连接到端口4430上的localhost、Docker nginx 自签名证书 - 无法连接到 https、Expressjs + Peerjs + nginx:无法连接到 Peerjs 服务器的知识。

本文目录一览:

将 nesjs 应用程序连接到 SQL Server Express 时出错:无法连接到 localhost:1433 - 自签名证书

将 nesjs 应用程序连接到 SQL Server Express 时出错:无法连接到 localhost:1433 - 自签名证书

如何解决将 nesjs 应用程序连接到 SQL Server Express 时出错:无法连接到 localhost:1433 - 自签名证书?

我正在尝试将我的 nestjs 应用程序连接到 sql Server Express,但出现此错误:

ConnectionError: 无法连接到 localhost:1433 - 自签名证书

注意:端口 1433 已打开,我可以通过 SSMS 进行连接:

import { Module } from ''@nestjs/common'';
import { TypeOrmModule } from ''@nestjs/typeorm'';
import { AppController } from ''./app.controller'';
import { AppService } from ''./app.service'';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: ''mssql'',host: ''localhost'',port: 1433,username: ''sa'',password: ''<mypassword>'',database: ''test'',entities: [__dirname + ''/**/*.entity{.ts,.js}'']
    })
  ],controllers: [AppController],providers: [AppService],})
export class AppModule {}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

c# – 无法从Visual Studio 2012连接到SQL Server Express 2014

c# – 无法从Visual Studio 2012连接到SQL Server Express 2014

我的问题是将数据从sql Server(Express 2014)检索到Visual Studio(Professional 2012).我正在关注下拉列表的教程.当我使用“选择数据源”时,我可以继续选择数据库.当我尝试使用’Microsoft sql Server数据库文件(sqlClient)’,并从我的App_Data文件夹中选择’norTHWND.MDF’我得到这个错误:

附加到数据库的尝试失败,并显示以下信息:
建立时发生网络相关或实例特定的错误
与sql Server的连接.服务器未找到或无法访问.
验证实例名称是否正确,并将sql Server配置为
允许远程连接(提供者:sql网络接口,错误:50 – 本地
发生数据库运行时错误.无法创建自动实例.看到Windows
应用程序事件日志中的错误详细信息.)

我没有什么在日志中这个.

当我尝试使用“Microsoft sql Server”连接到sql Server时,我可以访问sql Server实例,选择数据库并获取“连接成功”,但是在OK中可以得到此错误:

无法加载文件或程序集“Microsoft.sqlServer.Management.Sdk.Sfc,版本11.0.0.0
文化=中立,公钥令牌= 89845dcd8080cc91“或其依赖之一.
该系统找不到指定的文件.

我已经安装了sqlLocalDB.

帮助非常感谢,因为这是阻止我的学习.谢谢.

解决方法

我终于在应用程序事件日志中找到一条消息,指出了一个不兼容的问题…我推测这是在VS 2012和sql Server 2014之间.因此我安装了sql Server 2012.随后在VS 2012中运行“Web应用程序”,我发现自动创建的页面中的“注册”功能正确创建了一个用户,而之前它已经失败了,最初发布的错误.我假设VS 2012中的所有与sql Server相关的活动现在都可以正常工作,但是如果我发现其他情况将会报告回来.

centos – 无法连接到端口4430上的localhost

centos – 无法连接到端口4430上的localhost

我正在安装CentOS和Nginx的虚拟盒子中运行vagrant.我已经创建了从vagrant Box到远程服务器的反向隧道,但是当我尝试连接到端口4430上的localhost时,我在运行命令时遇到以下错误:

curl -v 'https://localhost:4430'

* About to connect() to localhost port 4430 (#0)
*   Trying ::1... Connection refused
*   Trying 127.0.0.1... Connection refused
* Couldn't connect to host
* Closing connection #0
curl: (7) Couldn't connect to host

我一直在尝试在浏览器中加载网站,但Chrome也会抛出错误.

This webpage is not available

ERR_CONNECTION_REFUSED

我想要做的是创建一个反向隧道似乎工作正常,我可以连接到远程机器并创建隧道,但我无法浏览我的本地机器上所需的(反向端口).

这是我的隧道脚本:

ssh -v -R 4430:localhost:443 user@remote-domain.com -N

有谁知道这个问题是什么?

我可以使用端口443而不是4430连接!

任何帮助,将不胜感激!

UPDATE

运行以下命令将提供以下输出

ssh -v -R 4430:localhost-domain:443 ec2-user@vm.domain.com -N

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to vm.domain.com [54.149.189.155] port 22.
debug1: Connection established.
debug1: identity file /home/vagrant/.ssh/identity type -1
debug1: identity file /home/vagrant/.ssh/identity-cert type -1
debug1: identity file /home/vagrant/.ssh/id_rsa type 1
debug1: identity file /home/vagrant/.ssh/id_rsa-cert type -1
debug1: identity file /home/vagrant/.ssh/id_dsa type -1
debug1: identity file /home/vagrant/.ssh/id_dsa-cert type -1
debug1: identity file /home/vagrant/.ssh/id_ecdsa type -1
debug1: identity file /home/vagrant/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'vm.domain.com' is kNown and matches the RSA host key.
debug1: Found key in /home/vagrant/.ssh/kNown_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/vagrant/.ssh/identity
debug1: Offering public key: /home/vagrant/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: Local connections to LOCALHOST:4430 forwarded to remote address localhost-domain:443
debug1: Local forwarding listening on ::1 port 4430.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 4430.
debug1: channel 1: new [port listener]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.

我在想LOCALHOST:4430应该是流浪盒的主机名吗?例如,本地域名:4430

解决方法:

我认为你缺少-g选项,因为否则远程端口只会在localhost上侦听,这意味着远程localhost之外的任何其他主机都无法连接到它.

使用-g它会监听0.0.0.0,这意味着它可以在所有接口上使用,而不仅仅是localhost.

正如ssh(1)所说的g选项“允许远程主机连接到本地转发端口.如果在多路复用连接上使用,则必须在主进程上指定此选项.”

您还提到您已经在流浪盒中创建了此隧道.所以这个卷曲你的展示也在流浪盒内,对吗?否则,如果您在主机系统上运行curl而不是在无法使用的vagrant Box内运行curl.如果要从主机系统(不在流浪盒内)连接到隧道,则必须连接到流浪盒的IP而不是127.0.0.1.

Docker nginx 自签名证书 - 无法连接到 https

Docker nginx 自签名证书 - 无法连接到 https

如何解决Docker nginx 自签名证书 - 无法连接到 https?

我一直在学习一些教程来尝试让我的 SSL 证书与我的 docker 环境一起工作。我决定走上带有 letencrypt 的自签名证书的路线。我已经使用以下命令生成了证书

certbot certonly --manual \
  --preferred-challenges=dns \
  --email {email_address} \
  --server https://acme-v02.api.letsencrypt.org/directory \
  --agree-tos \
  --manual-public-ip-logging-ok \
  -d "*.servee.co.uk"

注意:我使用多租户,所以我的域需要通配符

这有效,证书已在我的服务器上生成。我现在正在尝试将它与我的 docker Nginx 容器一起使用。

我的 docker-compose.yml 文件是这样的

...
services:
  Nginx:
    build:
      context: docker/Nginx
      dockerfile: Dockerfile
    ports:
      - 433:433
      - 80:80
    volumes:
      - ./src:/var/www/html:delegated
    depends_on:
      - app
      - MysqL
    networks:
      - laravel
...

这是我的 Dockerfile

FROM Nginx:stable-alpine

copY ./fullchain.pem /etc/Nginx/fullchain.pem
copY ./privkey.pem /etc/Nginx/privkey.pem

ADD Nginx.conf /etc/Nginx/Nginx.conf
ADD default.conf /etc/Nginx/conf.d/default.conf

RUN mkdir -p /var/www/html

RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel

RUN chown laravel:laravel /var/www/html

我正在将 pem 文件复制到 Nginx 容器中,以便我可以使用它们。

这是我的 default.conf 文件,它应该加载我的证书

server {
    listen 80;
    index index.PHP index.html;
    server_name servee.co.uk;
    root /var/www/html/public;

    location / {
        try_files $uri $uri/ /index.PHP?$query_string;
    }  

    location ~ \.PHP$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.PHP)(/.+)$;
        fastcgi_pass app:9000;
        fastcgi_index index.PHP;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }  
}

server {
    listen 443 ssl;
    server_name servee.co.uk;

    ssl_certificate /etc/Nginx/fullchain.pem;
    ssl_certificate_key /etc/Nginx/privkey.pem;

    index index.PHP index.html;
    
    location / {
        proxy_pass http://servee.co.uk; #for demo purposes
    }
}

Nginx 容器成功构建,当我猛击它时,我可以找到 pem 文件。问题是当我转到 https://servee.co.uk 时,我只是收到无法连接错误。如果我去 http://servee.co.uk,它工作正常。

我不确定我错过了什么,这真的让我放弃了 Docker,因为让 SSL 工作非常痛苦,所以希望它很容易解决。

解决方法

您需要更新您的 docker-compose.yml 文件以使用端口 443 而不是 433 来匹配您的 nginx.conf。试试下面的 docker-compose.yml 文件。

...
services:
  nginx:
    build:
      context: docker/nginx
      dockerfile: Dockerfile
    ports:
      - 443:443
      - 80:80
    volumes:
      - ./src:/var/www/html:delegated
    depends_on:
      - app
      - mysql
    networks:
      - laravel
...

Expressjs + Peerjs + nginx:无法连接到 Peerjs 服务器

Expressjs + Peerjs + nginx:无法连接到 Peerjs 服务器

如何解决Expressjs + Peerjs + nginx:无法连接到 Peerjs 服务器?

我正在使用 expressjs、peerjs 构建视频应用。连接到 peerjs 服务器时出现以下错误。该应用程序在代理服务器 (Nginx) 后面运行。代码在我的本地机器上运行良好(我在本地测试时没有使用代理服务器)。

`GET https://<servername>/peerjs/id?ts=16228299262200.9619575641336071 404 (Not Found)`

我在执行 "https://<servername>/peerjs" 时得到了结果。我假设我能够连接到 peerjs 服务器。我不明白为什么会出现上述错误。

{"name":"PeerJS Server","description":"代理的服务器端元素 PeerJS 客户端之间的连接。","website":"https://peerjs.com/"}

我正在将 peerjs 与 expressjs 结合起来

const ExpresspeerServer = require(''peer'').ExpresspeerServer;
const peerServer = ExpresspeerServer(server,{
  debug: true,proxied:true,});
app.use(''/peerjs'',peerServer);

客户端代码

let myPeer = new Peer({host :''servername'',secure:true})

下面是Nginx的配置

server {

  server_name <server_name>;

  location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection ''upgrade'';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
   }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/<server_name>/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/<server_name>/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-Nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = <server_name>) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  listen [::]:80;

  server_name <server_name>;
    return 404; # managed by Certbot


}

PS:我是 nodejs 和 Nginx 的新手。我觉得我遗漏了一些我无法弄清楚的非常基本的东西。

解决方法

嗨,在您的 nginx 配置文件中,在 proxy_pass 中添加 /peerjs。所以你的位置块应该看起来像

location / {
proxy_pass http://localhost:3000/peerjs;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection ''upgrade'';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;

}

关于将 nesjs 应用程序连接到 SQL Server Express 时出错:无法连接到 localhost:1433 - 自签名证书的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于c# – 无法从Visual Studio 2012连接到SQL Server Express 2014、centos – 无法连接到端口4430上的localhost、Docker nginx 自签名证书 - 无法连接到 https、Expressjs + Peerjs + nginx:无法连接到 Peerjs 服务器等相关内容,可以在本站寻找。

本文标签: