我收到以下错误
未能验证证书链,错误:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚。
我尝试使用“不同解决方案”,但仍然得到“是否相同”?是否有任何更新可忽略SSL证书。
我尝试了以下代码
wv.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
switch (error.getPrimaryError()) {
case SslError.SSL_UNTRUSTED:
Log.d(TAG, "onReceivedSslError: The certificate authority is not trusted.");
break;
case SslError.SSL_EXPIRED:
Log.d(TAG, "onReceivedSslError: The certificate has expired.");
break;
case SslError.SSL_IDMISMATCH:
Log.d(TAG, "onReceivedSslError: The certificate Hostname mismatch.");
break;
case SslError.SSL_NOTYETVALID:
Log.d(TAG, "onReceivedSslError: The certificate is not yet valid.");
break;
}
handler.proceed();
}
});