React native in-build websocket api support to TLS handshake

86 Views Asked by At

I am currently using React native in-build WebSocket api to create Websocket client. below is sample code to initialise connection. its all working fine now.

const ws = new WebSocket('ws://127.0.0.1:51221');

Next step here for me is to support secured connection with TLS handshake.

I have certificate authority, client cert and client key. But I don't see support in websocket api, I was expecting something like below and it would take care of TLS handshake.

const ws = new WebSocket('wss://127.0.0.1:51221', { ca: // CA certificate key: // Client private key cert: // Client certificate //Some other additional input. }); Need help on approach to support same.

0

There are 0 best solutions below