-
Notifications
You must be signed in to change notification settings - Fork 91
Closed
Description
Hey,
We have an android app with React Native code. React Native allow to override the default ok HTTP client for ALL network request from React Native with the following code:
OkHttpClient client =
new OkHttpClient().newBuilder()
.sslSocketFactory(trustKit.getSSLSocketFactory("www.mycompanydomain.com"),
trustKit.getTrustManager("www.mycompanydomain.com"))
.connectTimeout(0, TimeUnit.MILLISECONDS)
.readTimeout(0, TimeUnit.MILLISECONDS)
.writeTimeout(0, TimeUnit.MILLISECONDS)
.cookieJar(new ReactCookieJarContainer())
.build();
OkHttpClientProvider.replaceOkHttpClient(client);This work perfectly well, excpet for the fact that it will block all the request to API that are not belonging to my company - for example, firebase - because it will try to pin them with our domain configuration.
To solve this, we can use an approach similar to what CWAC did:
- Add a method to
PinningTrustManagerthat allow changing the domain configuration - Use the same code above to add TrustKit
PinningTrustManagerto React Native client - Add an interceptor to the client used by React Native, and change the host configuration before each request
Or we can try another approach, I am pretty open to ideas - for example, try to implement pinning in network interceptor - I will try to see if that possible.
Do you encounter similar problems? What will you recommend?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels