설치 및 dotnet 실행
WSL2 + Ubuntu-22.04 + .Net Runtime 7.0 + Oracle Client 19.3 설치
$ dotnet /home/test/test.dll > /dev/null 2>&1 & 실행
프로그램 테스트
oracle 연결 및 데이터 가져오는 프로그램 정상 동작
ms-sql 연결 및 데이터 가져오는 프로그램 오류 발생(윈도우 환경[동일 PC]에서 실행하면 정상 접근 가능)
Microsoft.Data.SqlClient.SqlException (0x80131904):
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)
ms-sql 현황 (현재 버전에서 해결책을 찾고 있습니다.)
windows 2008 r2 , mssql 2008 r2
ms-sql 오류 확인을 위해 진행해본 것
핫픽스 적용
Security Update for SQL Server 2008 R2 SP3 (KB4057113)
QueryString 내용 추가 : Encrypt=false;TrustServerCertificate=True;
$ sudo vi /etc/ssl/openssl.cnf 수정후 재기동
[system_default_sect]
CipherString = DEFAULT:@SECLEVEL=0
Ubuntu-20.04 로 변경 및 동일 환경 구성후 테스트
=> 문의사항
다른 해결책은 없을까요?
다른 리눅스 OS (CentOS, Rocky, Ubuntu 18.40 이하 버전 ) 사용해보면 다를까요?
2023-06-08 15:06:27.468 +09:00 ERR] Connection id “0HMR7SPS2BJEB”, Request id “0HMR7SPS2BJEB:00000004”: An unhandled exception was thrown by the application.
Microsoft.Data.SqlClient.SqlException (0x80131904): 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)
—> System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](CancellationToken cancellationToken)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)
at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)
at Microsoft.Data.SqlClient.SNI.SNITCPHandle.EnableSsl(UInt32 options)
at Microsoft.Data.SqlClient.SNI.TdsParserStateObjectManaged.EnableSsl(UInt32& info, Boolean tlsFirst, String serverCertificateFilename)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.InternalOpenAsync(CancellationToken cancellationToken)
— End of stack trace from previous location —
at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 417