!2578 【新增特性】支持webview的https的双向校验 - SSL错误通知

Merge pull request !2578 from zhangb/master
This commit is contained in:
openharmony_ci 2022-09-09 07:04:19 +00:00 committed by Gitee
commit cc715c7ff1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -260,6 +260,36 @@ declare enum RenderExitReason {
ProcessExitUnknown,
}
/**
* Enum type supplied to {@link error} when onSslErrorEventReceive being called.
* @since 9
*/
declare enum SslError {
/**
* General error.
* @since 9
*/
Invalid,
/**
* Hostname mismatch.
* @since 9
*/
HostMismatch,
/**
* The certificate date is invalid.
* @since 9
*/
DateInvalid,
/**
* The certificate authority is not trusted.
* @since 9
*/
Untrusted,
}
/**
* Enum type supplied to {@link FileSelectorParam} when onFileSelectorShow being called.
* @since 9
@ -435,6 +465,30 @@ declare class HttpAuthHandler {
isHttpAuthInfoSaved(): boolean;
}
/**
* Defines the ssl error request result, related to {@link onSslErrorEventReceive} method.
* @since 9
*/
declare class SslErrorHandler {
/**
* Constructor.
* @since 9
*/
constructor();
/**
* Confirm to use the SSL certificate.
* @since 9
*/
handleConfirm(): void;
/**
* Cancel this request.
* @since 9
*/
handleCancel(): void;
}
/**
* Defines the accessible resource type, related to {@link onPermissionRequest} method.
* @since 9
@ -1200,6 +1254,12 @@ declare class WebCookie {
* @since 9
*/
searchNext(forward: boolean): void;
/**
* Clears the ssl cache in the Web.
* @since 9
*/
clearSslCache(): void;
}
/**
@ -1665,6 +1725,14 @@ declare class WebAttribute extends CommonMethod<WebAttribute> {
* @since 9
*/
onScroll(callback: (event: {xOffset: number, yOffset: number}) => void): WebAttribute;
/**
* Triggered when the Web page receives an ssl Error.
* @param callback The triggered callback when the Web page receives an ssl Error.
*
* @since 9
*/
onSslErrorEventReceive(callback: (event: { handler: SslErrorHandler, error: SslError }) => void): WebAttribute;
}
declare const Web: WebInterface;