게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
JDK 업그레이드, SSL 질문드립니다..
게시물ID : programmer_15575짧은주소 복사하기
작성자 : 더보스
추천 : 0
조회수 : 2161회
댓글수 : 3개
등록시간 : 2016/01/22 16:57:29
옵션
  • 본인삭제금지
안녕하세요.

구글링하다가 정답을 못찾아서 질문드립니다.
JDK 1.4 에서 1.7로 업그레이드하여 프로그램 테스트 중, SSL쪽 connection 연결시 오류가 나네요..
1.4에서는 잘 돌던 소스였고, 1.7 컴파일 했습니다.

구글링 해보니 JDK 업그레이드 관련 SSLv2 오류인것 같은데 혹시 해결책 아시는분이 계실까요?
계속 찾아보고 있긴한데 쉽지가 않네요 ㅠ.ㅠ
javax.net.ssl.SSLException: Received fatal alert: unexpected_message
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)

아래는 connection 소스 입니다.
System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
URL url = new URL(null, strUrl, new sun.net.www.protocol.https.Handler());
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setHostnameVerifier(new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {         
return true;     
});
Authenticator.setDefault(new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("H", "test123".toCharArray());
}
});
con.setRequestProperty("Content-Type", "text/xml; charset=euc-kr");
con.setUseCaches(false);
con.setDoOutput(true);
con.connect();
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호