Код: Выделить всё
`Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
---> System.Security.Authentication.AuthenticationException: Certificate failed chain validation. Error(s): 'self-signed certificate, [Status: UntrustedRoot]
'.
Certificate name mismatch. The provided 'DataSource' or 'HostNameInCertificate' does not match the name in the certificate.
at Microsoft.Data.SqlClient.SNI.SNICommon.ValidateSslServerCertificate(String targetServerName, X509Certificate cert, SslPolicyErrors policyErrors)
at Microsoft.Data.SqlClient.SNI.SNITCPHandle.ValidateServerCertificate(Object sender, X509Certificate serverCertificate, X509Chain chain, SslPolicyErrors policyErrors)
at System.Net.Security.SslStream.VerifyRemoteCertificate(RemoteCertificateValidationCallback remoteCertValidationCallback, SslCertificateTrust trust, ProtocolToken& alertToken, SslPolicyErrors& sslPolicyErrors, X509ChainStatusFlags& chainStatus)`
Код: Выделить всё
` "Default": "Server=localhost,1433;Database=IWallet_dev;User Id=sa;Password=;TrustServerCertificate=True"`
Код: Выделить всё
`services:
mssql-db:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: mssql-db
hostname: mssql
ports:
- "1433:1433"
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=${MSSQL_SA_PASSWORD}
- MSSQL_ENABLE_ECR=0
volumes:
- sqlvolume:/var/opt/mssql
networks:
- mssql
restart: unless-stopped
volumes:
sqlvolume:
networks:
mssql:
driver: bridge`
Я пробовал все возможные исправления, добавляя Encrypt=false и т. д. в строку подключения, но ничего не работает
У меня также есть runtimeconfig.template.json для обхода проверки сертификата:
Код: Выделить всё
{
"configProperties": {
"System.Net.Security.AllowInsecureRemoteCertificateValidation": false
}
}
Кто-нибудь сталкивался с такой проблемой? Пожалуйста, помогите мне
С уважением.
Подробнее здесь: https://stackoverflow.com/questions/797 ... -error-occ
Мобильная версия