mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -13,6 +13,7 @@ import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
|
||||
/**
|
||||
* {@link SSLContext}构建器,可以自定义:<br>
|
||||
* <ul>
|
||||
|
@@ -0,0 +1,22 @@
|
||||
package cn.hutool.core.net.ssl;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.SSLSession;
|
||||
|
||||
/**
|
||||
* https 域名校验,信任所有域名
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
public class TrustAnyHostnameVerifier implements HostnameVerifier {
|
||||
|
||||
/**
|
||||
* 单例对象
|
||||
*/
|
||||
public static TrustAnyHostnameVerifier INSTANCE = new TrustAnyHostnameVerifier();
|
||||
|
||||
@Override
|
||||
public boolean verify(final String hostname, final SSLSession session) {
|
||||
return true;// 直接返回true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user