mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-17 21:25:31 +00:00
优化:gotify忽略https证书
This commit is contained in:
parent
e03e3d8513
commit
cb8ea2e2ea
@ -6,6 +6,7 @@ import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.idormy.sms.forwarder.model.vo.GotifySettingVo;
|
||||
import com.idormy.sms.forwarder.utils.CertUtils;
|
||||
import com.idormy.sms.forwarder.utils.Define;
|
||||
import com.idormy.sms.forwarder.utils.LogUtil;
|
||||
|
||||
@ -42,6 +43,8 @@ public class SenderGotifyMsg extends SenderBaseMsg {
|
||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||
//设置重试拦截器
|
||||
if (retryInterceptor != null) builder.addInterceptor(retryInterceptor);
|
||||
//忽略https证书
|
||||
builder.sslSocketFactory(CertUtils.getSSLSocketFactory(), CertUtils.getX509TrustManager()).hostnameVerifier(CertUtils.getHostnameVerifier());
|
||||
//设置读取超时时间
|
||||
OkHttpClient client = builder
|
||||
.readTimeout(Define.REQUEST_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||
|
Loading…
Reference in New Issue
Block a user