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

cn.hutool.http.ssl.AndroidSupportSSLFactory Maven / Gradle / Ivy

There is a newer version: 5.8.32
Show newest version
package cn.hutool.http.ssl;

import cn.hutool.core.io.IORuntimeException;
import cn.hutool.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 - 2024 Weber Informatics LLC | Privacy Policy