
com.magictools.http.ssl.DefaultSSLInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magic-tools-all Show documentation
Show all versions of magic-tools-all Show documentation
magic-tools 是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
The newest version!
package com.magictools.http.ssl;
import com.magictools.core.util.StrUtil;
import javax.net.ssl.SSLSocketFactory;
/**
* 默认的全局SSL配置,当用户未设置相关信息时,使用默认设置,默认设置为单例模式。
*
* @author looly
* @since 5.1.2
*/
public class DefaultSSLInfo {
/**
* 默认信任全部的域名校验器
*/
public static final TrustAnyHostnameVerifier TRUST_ANY_HOSTNAME_VERIFIER;
/**
* 默认的SSLSocketFactory,区分安卓
*/
public static final SSLSocketFactory DEFAULT_SSF;
static {
TRUST_ANY_HOSTNAME_VERIFIER = new TrustAnyHostnameVerifier();
if (StrUtil.equalsIgnoreCase("dalvik", System.getProperty("java.vm.name"))) {
// 兼容android低版本SSL连接
DEFAULT_SSF = new AndroidSupportSSLFactory();
} else {
DEFAULT_SSF = new DefaultSSLFactory();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy