Skip to content

Using setClientAuthenticationCredential with SSL pinning #2765

@drsaxi

Description

@drsaxi

I'm wondering if other people have run into this same issue that I am experiencing regarding SSL pinning and using the setClientAuthenticationCredential.

Before I started implementing SSL pinning I was calling the setClientAuthenticationCredential method from the RCTCustomWebViewManager. The server that I am connecting to requires a client certificate in order for the webview to access it and I'm doing some code in there to retrieve a local certificate, create credentials and load it into the webview which works fine so far.

However, now that I need to implement SSL pinning I always get an error afterwards saying that the host needs a client certificate in order to connect. I'm tapping into the didReceiveAuthenticationChallenge in order to do the pinning check and now Im wondering if setClientAuthenticationCredential should be moved to the completion handler of the method?

Screenshot 2022-11-29 at 11 28 55

However, this does not seem to make any difference since I am still getting an error saying that the server requires a certificate.

Is there another way to perform SSL pinning and then setting the credentials via RNCWebview ? There seem to be very limited resources online regarding this issue using the react-native-webview so Im hoping someone here might be able to shed some light on the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions