1
서버에 요청을 보내려고하지만 다음과 같은 오류가 발생합니다. 인증서를 만들어야하지만 어떻게해야하는지 잘 모르기 때문입니다. 이 answer을 발견했지만 구현할 수 없습니다.Java로 CertificateException을 우회하는 방법은 무엇입니까?
java.security.cert.CertificateException: No subject alternative DNS name matching www.example.com found.
코드
URL url = new URL("https://www.example.com:1897/services/myservice");
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setDoOutput(true);
con.setDoInput(true);
OutputStream os = con.getOutputStream();
m.marshal(auth, os);
m.marshal(auth, System.out);
os.flush();
con.getResponseCode();
SAN 확장에 올바른 서버 호스트 이름으로 인증서를 업데이트하도록 요청해야합니까? 그렇지 않다면 더 많은 것을 설명하거나 더 많은 정보를 얻기 위해 몇 가지 출처를 소개해 주시겠습니까? 감사합니다. –
네, 그렇습니다. 그것은 인증서를 보지 않고도 확실히 말하기 어렵습니다. – erickson
이메일 주소를 알려 주시면 인증서를 보낼 수 있습니다. –