卡了一天是時間框全;在其他平板上都正常喘沿,在其中一個安卓9平板上窄赋,怎么操作,都是請求失敗。okhttp onfailure
整個項目是以前的老項目,APICLoud SDK 原生打包方式皆撩。
1、一開始是以為 是androidManifest.xml 問題哲银。
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:remove="android:requestLegacyExternalStorage"
包括配置:xml/network_security_config
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
結(jié)果是不行扛吞。
2、然后懷疑是okhttp 版本不對荆责,試驗了滥比,
com.squareup.okhttp3:okhttp:3.6.0
com.squareup.okhttp3:okhttp:3.10.0
com.squareup.okhttp3:okhttp:4.0.1
還是不對。
3做院、然后盲泛,一行行打日志分析源代碼濒持。
結(jié)論是:javax.net.ssl.SSLHandshakeException: Chain validation failed
這就好找了,檢查證書寺滚,時間柑营,檢查pad時間。發(fā)現(xiàn)pad時間村视,是兩年前由境。修改時間,OK可以了蓖议。