Microsoft MVP성태의 닷넷 이야기
오류 유형: 857. Microsoft.Data.SqlClient.SqlException - 0x80131904 [링크 복사], [링크+제목 복사],
조회: 13113
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 3개 있습니다.)

Microsoft.Data.SqlClient.SqlException - 0x80131904

다음과 같이 연결 문자열을 주면,

Password=...;Integrated Security=false;User ID=...;Initial Catalog=...;Data Source=192.168.100.50;

현재의 Microsoft.Data.SqlClient에서는 이런 예외가 발생합니다.

Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
---> System.ComponentModel.Win32Exception (0x80090325): The certificate chain was issued by an authority that is not trusted.
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
...[생략]...
at Microsoft.Data.SqlClient.SqlConnection.Open()
at ConsoleApp1.Program.Main(String[] args) in C:\temp\ConsoleApp1\ConsoleApp1\Program.cs:line 13


윈도우 환경에서 위와 같이 오류가 발생하는데요, "The certificate chain was issued by an authority ...." 메시지를 통해 SSL 통신 문제라는 것을 알 수 있고, 아래의 문서에 따른 해결책을 따르면 됩니다.

"The certificate chain was issued by an authority that is not trusted" error after upgrading SNAC applications
; https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/certificate-chain-not-trusted

가령, 3번째 방법을 택한다면 연결 문자열에 TrustServerCertificate 설정만 추가하면 됩니다.

TrustServerCertificate=true;Password=...;Integrated Security=false;User ID=...;Initial Catalog=...;Data Source=192.168.100.50

그런데, (버전 차이일지 모르겠지만) 제가 가진 Container의 리눅스 환경에서는 오류 메시지가 다음과 같이 나옵니다.

Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server)


그래서 얼핏 오류 메시지만 봐서는 서버로의 연결에 문제가 있다고 잘못 생각할 수 있습니다. ^^;




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 5/8/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 181  182  183  184  185  186  [187]  188  189  190  191  192  193  194  195  ...
NoWriterDateCnt.TitleFile(s)
317정성태8/12/200627738    답변글 디버깅 기술: 5.5. VS.NET 2005 디버그 모드에서의 PDB 파일 사용 차이 (2)
318정성태8/12/200634169    답변글 디버깅 기술: 5.6. VS.NET 2005를 이용한 미니덤프 파일 분석 (1)
319정성태8/12/200629317    답변글 디버깅 기술: 5.7. VS.NET 2005를 이용한 미니덤프 파일 분석 (2) [1]
320정성태8/12/200633371    답변글 디버깅 기술: 5.8. WinDBG를 이용한 미니덤프 파일 분석 [1]
321정성태8/13/200637988    답변글 디버깅 기술: 5.9. Microsoft의 PDB 파일 관리
323정성태8/15/200639378    답변글 디버깅 기술: 5.10. Symbol Server 생성 [4]
324정성태8/15/200635889    답변글 디버깅 기술: 5.11. PDB 파일과 소스 코드
325정성태9/8/200628698    답변글 디버깅 기술: 5.12. CCP를 이용한 Windows Source Code 수준의 디버깅
329정성태8/19/200627630    답변글 디버깅 기술: 5.13. 소스 서버 구성 [1]
332정성태8/20/200629133    답변글 디버깅 기술: 5.14. GAC 에 등록된 Assembly 디버그 [2]
341정성태9/16/200621509    답변글 디버깅 기술: 5.15. [내용 예약]
342정성태9/16/200639076    답변글 디버깅 기술: 5.16. ASP.NET 디버깅 환경 구성 [1]파일 다운로드1
306정성태2/13/200718550기타: 15. .NET 이 생산성이 높다는 증거(!)
304정성태7/21/200620605VS.NET IDE: 41. 하위 폴더의 모든 프로젝트의 출력물을 제거 (Clean)
305정성태7/21/200620318    답변글 VS.NET IDE: 41.1. 하위 폴더의 모든 프로젝트의 출력물을 제거 (Clean) [1]
303정성태7/20/200618269Team Foundation Server: 12. 사용자 계정 재생성에 따른 Version Control 영향
302정성태8/21/200620000Team Foundation Server: 11. TFS Team Build와 VC++ Project 설정
299정성태7/23/200620167개발 환경 구성: 5. VMWare - VM 생성 화면 캡쳐
300정성태7/15/200624715    답변글 개발 환경 구성: 5.1. VMWare 오류 유형 - The handle is invalid.
301정성태7/18/200619697    답변글 개발 환경 구성: 5.2. VMWare - 사용 후기.
298정성태7/14/200619939개발 환경 구성: 4. VMWare Server를 64bit 운영체제에 설치 시 주의 사항 [2]
296정성태7/10/200629273.NET Framework: 73. [ASP.NET] HTC(DHTML Control Behavior)를 WebResource.axd로 제공하는 방법 [3]
295정성태7/1/200622512VC++: 25. Microsoft National Language Support Downlevel APIs 1.0 사용 방법파일 다운로드1
294정성태6/30/200619069.NET Framework: 72. XSDObjectGen.EXE 기능 개선
293정성태6/29/200620844Team Foundation Server: 10. TFS 버전 컨트롤(TFVC)에 참여시킨 프로젝트의 로컬 경로를 옮기는 방법
290정성태6/26/200618282Team Foundation Server: 9. HTTPS를 통한 Team Server 접근 - 두 번째 이야기 [1]
... 181  182  183  184  185  186  [187]  188  189  190  191  192  193  194  195  ...