Olá! Segui a configuração sugerida pelo colega nesse post: Criação do Ambiente em Linux , porem, não consigo fazer o app conectar ao banco. Tentei diversas strings de conexão diferentes, como:
Server=localhost,1434;Database=AluraLeiloesDB;Integrated Security = True;User Id=sa;Password=1q2w3e4r@#$;Trusted_Connection=False; TrustServerCertificate=True;
Server=localhost,1434;Database=AluraLeiloesDB;User ID=sa;Password=1q2w3e4r@#$;Trusted_Connection=False; TrustServerCertificate=True;
Server=host.docker.internal;Database=AluraLeiloesDB;User ID=sa;Password=1q2w3e4r@#$;
"Data Source=localhost,1434;Initial Catalog=AluraLeiloesDB; Integrated Security=true; User=sa; Password=1q2w3e4r@#$; Trusted_Connection=False; TrustServerCertificate=True;"
e continuo tento a mesma falha:
dotnet run
Unhandled exception. 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: Authentication failed, see inner exception.
---> System.TypeInitializationException: The type initializer for 'SslMethods' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Ssl' threw an exception.
---> System.TypeInitializationException: The type initializer for 'SslInitializer' threw an exception.
---> Interop+Crypto+OpenSslCryptographicException: error:0E076071:configuration file routines:module_run:unknown module name
at Interop.SslInitializer..cctor()
--- End of inner exception stack trace ---
at Interop.Ssl..cctor()
--- End of inner exception stack trace ---
at Interop.Ssl.SslV2_3Method()
at Interop.Ssl.SslMethods..cctor()
--- End of inner exception stack trace ---
O container está rodando, dá para acessar o banco e rodar logs. Também consegui conectar externamente ao container pelo Azure Data Studio. Até criei o database e testei fazendo a conexão por string e funcionou normalmente. A exceção fala do “ssl”, pode ser algum conflito de versões?
Versão ssl da máquina:
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)