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 | 31 |
Tags
- Kotlin
- table
- NPM
- SPC
- Spring
- GIT
- JavaScript
- 공정능력
- Android
- Express
- tomcat
- R
- maVen
- Python
- mybatis
- 보조정렬
- window
- Sqoop
- es6
- xPlatform
- Eclipse
- 정렬
- vaadin
- hadoop
- mapreduce
- MSSQL
- IntelliJ
- react
- Java
- SQL
Archives
- Today
- Total
DBILITY
독거 가능성 100% 노후에 라면값이라도 하게 센스를 발휘합시다!😅
Please click on the ad so that I can pay for ramen in my old age!
点击一下广告,让老后吃个泡面钱吧!
老後にラーメン代だけでもするように広告を一回クリックしてください。
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:27반응형
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());
}
반응형
'java' 카테고리의 다른 글
java substring usage (0) | 2022.08.25 |
---|---|
java 7 multiple exception catch (0) | 2016.10.04 |
Comments