All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.magictools.http.ssl.AndroidSupportSSLFactory Maven / Gradle / Ivy

Go to download

magic-tools 是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。

The newest version!
package com.magictools.http.ssl;

import com.magictools.core.io.IORuntimeException;
import com.magictools.core.net.SSLProtocols;

/**
 * 兼容android低版本SSL连接
* 在测试HttpUrlConnection的时候,发现一部分手机无法连接[GithubPage] * *

* 最后发现原来是某些SSL协议没有开启 * * @author MikaGuraNTK */ public class AndroidSupportSSLFactory extends CustomProtocolsSSLFactory { // Android低版本不重置的话某些SSL访问就会失败 private static final String[] protocols = { SSLProtocols.SSLv3, SSLProtocols.TLSv1, SSLProtocols.TLSv11, SSLProtocols.TLSv12}; public AndroidSupportSSLFactory() throws IORuntimeException { super(protocols); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy