Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- table
- Java
- Kotlin
- tomcat
- Python
- Android
- 보조정렬
- SQL
- GIT
- window
- Eclipse
- Sqoop
- MSSQL
- plugin
- Express
- 공정능력
- Spring
- hadoop
- IntelliJ
- mybatis
- react
- xPlatform
- SPC
- vaadin
- NPM
- SSL
- mapreduce
- JavaScript
- R
- es6
Archives
- Today
- Total
DBILITY
java.security.cert.CertificationException : No subject alternative DNS name matching "xxx" found 본문
java
java.security.cert.CertificationException : No subject alternative DNS name matching "xxx" found
DBILITY 2022. 8. 11. 11:27728x90
반응형
hostname verifier에러에 그냥 구글 검색으로 대응했다.
기록해 두자.
try {
URL url = new URL(requestURL);
TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType){
}
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
} };
HostnameVerifier hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new SecureRandom());
HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier);
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
httpConn = (HttpsURLConnection) url.openConnection();
} catch( Exception e) {
System.out.println(e.toString());
}
728x90
'java' 카테고리의 다른 글
java substring usage (0) | 2022.08.25 |
---|---|
java 7 multiple exception catch (0) | 2016.10.04 |
Comments