[HttpClient] javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
ITWeb/개발일반 2017. 2. 6. 11:33http 통신 기능 구현 시 아래와 같은 에러를 접하는 경우가 있어서 해결 방법을 기록해 봅니다.
[에러내용]
javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
at sun.security.ssl.ClientHandshaker.handshakeAlert(ClientHandshaker.java:1441)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2016)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
[해결방법]
JVM 실행 시 옵션 추가)
-Djsse.enableSNIExtension=false
Application 내부에서 설정 추가)
System.setProperty(“jsse.enableSNIExtension”, “false”);