【发布时间】:2021-07-14 01:15:20
【问题描述】:
自从将我的 Linux 服务器设置为托管 dotnet 应用程序后,我一直收到此错误,它尝试连接到在 Windows 环境(2012 版)上运行的数据库引擎 SQL Server。 linux服务器正在运行.Net 5,我试图在/usr/local/share/ca-certificates文件夹下拥有一个证书,到目前为止没有运气。我也将 nginx 配置为使用 ssl:
server {
listen 80;
listen 443 ssl;
server_name 111.111.111.111;
ssl on;
ssl_certificate /usr/local/share/ca-certificates/cert.crt;
ssl_certificate_key /usr/local/share/ca-certificates/cert.key;
location /core/ {
proxy_pass https://127.0.0.1:7001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
//错误
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31 - Encryption(ssl/tls) handshake failed)
//连接字符串
"Server=111.111.111.111\\TESTDB4;Initial Catalog=Core;User ID=demo;Password=password;Integrated Security=False;TrustServerCertificate=False;Trusted_Connection=True;Encrypt=True;"
【问题讨论】:
-
使用 Wireshark 之类的工具来分析 TLS 握手失败的原因。这比尝试您找到的每个提示更重要。
-
@LexLi 会调查的,我觉得此时我只是把所有东西都扔在墙上
标签: linux nginx .net-core sql-server-2012 .net-5