spring boot, ms-sql 연동시 java.security.cert.CertificateException 에러 발생(SSL 설정관련)
Spring boot와 ms-sql 연동시 SSL 접속 에러
1. 개발 및 배포 조건
- os : linux(로키)
- spring boot : 2.6
- java : 1.8 JDK
- ms-sql : 2012
2. 에러 증상
- The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Certificates do not conform to algorithm constraints".
3. 에러 원인
- 기존에 사용되는 java 1.8.0_262이하 버전에서는 특별한 SSL 설정이 필요하지 않았음
- SSL 설정과 관련되어 java.security에 아래부분도 주석처리한다.
- # jdk.tls.disabledAlgorithms~~~~
# jdk.certpath.disabledAlgorithms~~~
- java 1.8.0_392 이상을 사용하게 되면서 java.security에 "security.useSystemPropertiesFile" 항목이 추가되어 있어 다음과 같이 설정해줘야한다.
security.useSystemPropertiesFile=false
*java.security 위치 찾기 : find / -name java.security
4. 추가 확인 사항
- java 11이상 버전에서도 적용이 되는지 확인 해야함
- 연동하는 mssql 서버에서 ssl 적용이 되었을 때만 해당되는지 확인해야 함
댓글
댓글 쓰기