第一,ssl 问题看下面
https://docs.microsoft.com/zh-CN/sql/connect/ado-net/sqlclient-troubleshooting-guide?view=sql-server-linux-ver15
第二,连接问题看下面,
https://www.cnblogs.com/xiaxiaolu/p/10309064.html
总结:
一,
docker 中如果不支持 tls 1.2
sed -i 's/TLSv1.2/TLSv1/g' /etc/ssl/openssl.cnf;
sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf;
运行着两句,修改最低版本。
二,
Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=3; handshake=10; [Login] initialization=0; authentication=0; [Post-Login] complete=14074;
出现这个错误,看看数据库版本。
.net core 的System.Data.SqlClient支持的最低SqlServer版本是2008 r2 SP3,小于这个版本的就会报这个错。