I have a self signed certificate file(Let's call it cert.pem) and I would like to connect to my ssl encrypted server with my react native app(I'm using expo, if that is relevant). I can do this in python using the following lines of code:
uri = "wss://{hostname}:{port}"
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_context.load_verify_locations("cert.pem")
websocket = websockets.connect(uri, ssl=ssl_context)
Essentially, I would like to replicate this behavior in my react native app. I am trying to use var ws = new WebSocket(...arguments...), but I am not sure what arguments I should use to connect to my server. If there is a better way than using the WebSockets() constructor, please let me know.