pub trait ICoreWebView2_5: ICoreWebView2_4 {
// Required methods
unsafe fn add_client_certificate_requested(
&self,
event_handler: *mut *mut ICoreWebView2ClientCertificateRequestedEventHandlerVTable,
token: *mut EventRegistrationToken,
) -> HRESULT;
unsafe fn remove_client_certificate_requested(
&self,
token: EventRegistrationToken,
) -> HRESULT;
}Expand description
A continuation of the ICoreWebView2_4 interface to support ClientCertificateRequested event.
Required Methods§
Sourceunsafe fn add_client_certificate_requested(
&self,
event_handler: *mut *mut ICoreWebView2ClientCertificateRequestedEventHandlerVTable,
token: *mut EventRegistrationToken,
) -> HRESULT
unsafe fn add_client_certificate_requested( &self, event_handler: *mut *mut ICoreWebView2ClientCertificateRequestedEventHandlerVTable, token: *mut EventRegistrationToken, ) -> HRESULT
Add an event handler for the ClientCertificateRequested event. The ClientCertificateRequested event is raised when the WebView2 is making a request to an HTTP server that needs a client certificate for HTTP authentication. Read more about HTTP client certificates at RFC 8446 The Transport Layer Security (TLS) Protocol Version 1.3.
With this event you have several options for responding to client certificate requests:
| Scenario | Handled | Cancel | SelectedCertificate |
|---|---|---|---|
| Respond to server with a certificate | True | False | MutuallyTrustedCertificate value |
| Respond to server without certificate | True | False | null |
| Display default client certificate selection dialog prompt | False | False | n/a |
| Cancel the request | n/a | True | n/a |
If you don’t handle the event, WebView2 will show the default client certificate selection dialog prompt to user.
\snippet SettingsComponent.cpp ClientCertificateRequested1 \snippet ScenarioClientCertificateRequested.cpp ClientCertificateRequested2
Sourceunsafe fn remove_client_certificate_requested(
&self,
token: EventRegistrationToken,
) -> HRESULT
unsafe fn remove_client_certificate_requested( &self, token: EventRegistrationToken, ) -> HRESULT
Remove an event handler previously added with add_ClientCertificateRequested.
Trait Implementations§
Source§impl ComInterface for dyn ICoreWebView2_5
impl ComInterface for dyn ICoreWebView2_5
Source§type VTable = ICoreWebView2_5VTable
type VTable = ICoreWebView2_5VTable
Source§type Super = dyn ICoreWebView2_4
type Super = dyn ICoreWebView2_4
Source§fn is_iid_in_inheritance_chain(riid: &GUID) -> bool
fn is_iid_in_inheritance_chain(riid: &GUID) -> bool
Source§impl<C: ICoreWebView2_5> ProductionComInterface<C> for dyn ICoreWebView2_5
impl<C: ICoreWebView2_5> ProductionComInterface<C> for dyn ICoreWebView2_5
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".