Is it possible to use Mutual TLS on the client side using the managed workflow?

SDK Version: 41.0.1
Platforms: Android and iOS

I have a hard requirement to support mutual TLS in an application I have build using the Expo managed workflow. I am not against ejecting but first I would like to know if its possible to support mutual TLS.

i.e. I would like to add the client certificates etc. to any outgoing https requests that the application makes.

I am currently using axios to make requests but I am happy to swap this out. See this link on how to support this in axios: https://smallstep.com/hello-mtls/doc/client/axios. Although it is my understanding this doesn’t work as react native and therefore expo doesn’t support creating a custom https agent with https node api: https://nodejs.org/api/https.html.

If its not possible with the managed workflow, does anyone know if it is possible in the bare workflow without using native code?

Hi

As far as I know React Native doesn’t support this. Here’s the feature request:

As lacker says on the issue linked to that feature request:

You should be able to do this by writing a library to use client certificate authentication in native code, and then using NativeModules to call it from javascript. For example, if there’s an iOS or Android library you like for this, you can just call it this way.

I have not done something like this before, but I suppose if you can write some native code that uses client a certificate and fetches a given URL and then returns the data to the JS code, then that should give you what you need.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.