mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -23,6 +23,8 @@ import org.dromara.hutool.http.client.engine.ClientEngine;
|
|||||||
import org.dromara.hutool.http.proxy.HttpProxy;
|
import org.dromara.hutool.http.proxy.HttpProxy;
|
||||||
import org.dromara.hutool.http.ssl.SSLInfo;
|
import org.dromara.hutool.http.ssl.SSLInfo;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
import javax.net.ssl.X509TrustManager;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.PasswordAuthentication;
|
import java.net.PasswordAuthentication;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@@ -101,8 +103,12 @@ public class OkHttpEngine implements ClientEngine {
|
|||||||
|
|
||||||
// SSL
|
// SSL
|
||||||
final SSLInfo sslInfo = conf.getSslInfo();
|
final SSLInfo sslInfo = conf.getSslInfo();
|
||||||
if (null != sslInfo && null != sslInfo.getSocketFactory() && null != sslInfo.getTrustManager()){
|
if (null != sslInfo){
|
||||||
builder.sslSocketFactory(sslInfo.getSocketFactory(), sslInfo.getTrustManager());
|
final SSLSocketFactory socketFactory = sslInfo.getSocketFactory();
|
||||||
|
final X509TrustManager trustManager = sslInfo.getTrustManager();
|
||||||
|
if(null != socketFactory && null != trustManager){
|
||||||
|
builder.sslSocketFactory(socketFactory, trustManager);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置代理
|
// 设置代理
|
||||||
|
Reference in New Issue
Block a user