Cannot connect to https using Self Signed Certificate


#1

Hi,
I’ve been scratching my head trying to figure out how to get my RN Expo app to connect to my server that only has an IP, no domain (for various reasons, this is an internal app that will only ever connect to an IP) - I’m using a Self Signed SSL certificate here. Using the Expo Debug Inspector on my Android phone, when it is making wss:// connections to my IP, I get “Hostname cannot be verified”.

Is there any way to force my app to make a WebSocket connection to the https URL without timing out? (Socket timed out).

Another detail is that I am using feathers socket IO to make the connect like this:

const options = {
transports: [‘websocket’],
forceNew: true,
rejectUnauthorized: false,
secure: true,
};

const MOBILE_SERVER_IP = ‘https://:3030’;

const socket = io(MOBILE_SERVER_IP, options);

// Initilize the feathersClient object
const feathersClient = feathers()
.configure(socketio(socket))
.configure(
auth({
storage: AsyncStorage,
timeout: 60000
})
);

Thanks!


#2

Use ngrok - it will provide you an https address you can use on client side