本文整理匯總了Java中android.webkit.SslErrorHandler.cancel方法的典型用法代碼示例。如果您正苦於以下問題:Java SslErrorHandler.cancel方法的具體用法?Java SslErrorHandler.cancel怎麽用?Java SslErrorHandler.cancel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.webkit.SslErrorHandler
的用法示例。
在下文中一共展示了SslErrorHandler.cancel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
{
/*
* in theory this should be checked to make sure it's not null but if there is some failure
* in the association then usage of webViewProxy should trigger a NPE to make sure the issue
* is not ignored
*/
KrollProxy webViewProxy = this.webView.getProxy();
KrollDict data = new KrollDict();
data.put(TiC.ERROR_PROPERTY_CODE, error.getPrimaryError());
webView.getProxy().fireSyncEvent(TiC.EVENT_SSL_ERROR, data);
boolean ignoreSslError = false;
try {
ignoreSslError = webViewProxy.getProperties().optBoolean(TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR, false);
} catch(IllegalArgumentException e) {
Log.e(TAG, TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR + " property does not contain a boolean value, ignoring");
}
if (ignoreSslError == true) {
Log.w(TAG, "ran into SSL error but ignoring...");
handler.proceed();
} else {
Log.e(TAG, "SSL error occurred: " + error.toString());
handler.cancel();
}
}
示例2: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
handler.cancel();
// WebView can try to load the favicon for a bad page when you set a new URL. If we then
// loadErrorPage() again, WebView tries to load the favicon again. We end up in onReceivedSSlError()
// again, and we get an infinite loop of reloads (we also erroneously show the favicon URL
// in the toolbar, but that's less noticeable). Hence we check whether this error is from
// the desired page, or a page resource:
if (error.getUrl().equals(currentPageURL)) {
TelemetryWrapper.sslErrorEvent(true, error);
ErrorPage.loadErrorPage(view, error.getUrl(), WebViewClient.ERROR_FAILED_SSL_HANDSHAKE);
} else {
TelemetryWrapper.sslErrorEvent(false, error);
}
}
示例3: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (DISABLE_SSL_CHECK_FOR_TESTING) {
handler.proceed();
} else {
super.onReceivedSslError(view, handler, error);
handler.cancel();
sendErrorToListener(new FacebookDialogException(null, ERROR_FAILED_SSL_HANDSHAKE, null));
}
}
示例4: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (DISABLE_SSL_CHECK_FOR_TESTING) {
handler.proceed();
} else {
super.onReceivedSslError(view, handler, error);
sendErrorToListener(new FacebookDialogException(null, ERROR_FAILED_SSL_HANDSHAKE, null));
handler.cancel();
WebDialog.this.dismiss();
}
}
示例5: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
LogInfo.log("LM", "onReceivedSslError");
if (LetvWebViewActivity.this.baseUrl.contains(LetvUtils.WEB_INNER_FLAG) || !LetvConfig.getPcode().equals("010110016")) {
handler.proceed();
} else {
handler.cancel();
}
}
示例6: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (HongKongLoginWebview.this.baseUrl.contains(LetvUtils.WEB_INNER_FLAG) || !LetvConfig.getPcode().equals("010110016")) {
handler.proceed();
} else {
handler.cancel();
}
}
示例7: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (LetvOpenIDOAuthLoginActivity.this.baseUrl.contains(LetvUtils.WEB_INNER_FLAG) || !LetvConfig.getPcode().equals("010110016")) {
handler.proceed();
} else {
handler.cancel();
}
}
示例8: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (this.mCallBack != null) {
this.mCallBack.onReceivedSslErrorCallBack(view, handler, error);
}
handler.cancel();
this.mShareRequestParam.sendSdkErrorResponse(this.mAct, "ReceivedSslError");
WeiboSdkBrowser.closeBrowser(this.mAct, this.mShareRequestParam.getAuthListenerKey(), null);
}
示例9: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@TargetApi(8)
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError
sslError) {
sslErrorHandler.cancel();
this.a.c.onError(new UiError(sslError.getPrimaryError(),
"請求不合法,請檢查手機安全設置,如係統時間、代理等。", "ssl error"));
this.a.dismiss();
}
示例10: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
super.onReceivedSslError(view, handler, error);
sendErrorToListener(new KakaoWebviewException(ERROR_FAILED_SSL_HANDSHAKE, null, null));
handler.cancel();
dismiss();
}
示例11: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
handler.cancel();
view.stopLoading();
mActivity.finishWithResult(
ThreeDSecureAuthenticationResponse.fromException(error.toString()));
}
示例12: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
/**
* Catch (self-signed) SSL errors and test if they correspond to Syncthing's certificate.
*/
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
try {
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
// The mX509Certificate field is not available for ICS- devices
Log.w(TAG, "Skipping certificate check for devices <ICS");
handler.proceed();
return;
}
// Use reflection to access the private mX509Certificate field of SslCertificate
SslCertificate sslCert = error.getCertificate();
Field f = sslCert.getClass().getDeclaredField("mX509Certificate");
f.setAccessible(true);
X509Certificate cert = (X509Certificate)f.get(sslCert);
if (cert == null) {
Log.w(TAG, "X509Certificate reference invalid");
handler.cancel();
return;
}
cert.verify(mCaCert.getPublicKey());
handler.proceed();
} catch (NoSuchFieldException|IllegalAccessException|CertificateException|
NoSuchAlgorithmException|InvalidKeyException|NoSuchProviderException|
SignatureException e) {
Log.w(TAG, e);
handler.cancel();
}
}
示例13: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
if (DISABLE_SSL_CHECK_FOR_TESTING) {
handler.proceed();
} else {
super.onReceivedSslError(view, handler, error);
sendErrorToListener(new FacebookDialogException(null,
ERROR_FAILED_SSL_HANDSHAKE,
null));
handler.cancel();
WebDialog.this.dismiss();
}
}
示例14: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
// 當發生證書認證錯誤時,采用默認的處理方法handler.cancel(),停止加載問題頁麵
handler.cancel();
}
示例15: onReceivedSslError
import android.webkit.SslErrorHandler; //導入方法依賴的package包/類
@TargetApi(8)
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
sslErrorHandler.cancel();
this.a.c.onError(new UiError(sslError.getPrimaryError(), "請求不合法,請檢查手機安全設置,如係統時間、代理等。", "ssl error"));
this.a.dismiss();
}