简体   繁体   中英

Cant connect to socket.io with an SSL connection using react native/expo

For some very weird reason my android react native app is not connecting to socket.io over https. However when I use a tunnel program like ngrok or when i use http it works perfectly fine. I am using a valid SSL connection from sectigo and its still not connecting.

If anyone can help me fix this issue I would really appreciate it!

There are a few things you can try to troubleshoot the issue with your React Native app not connecting to socket.io over HTTPS:

Verify that the SSL certificate is valid and properly installed on the server. Make sure that the certificate is signed by a trusted authority and that the server is configured to use the correct certificate.

Check the server's firewall settings to make sure that it is configured to allow incoming connections on the correct port (usually 443 for HTTPS).

Make sure that the React Native app is configured to connect to the server over HTTPS. This may involve setting the appropriate protocol (https://) in the connection URL and adding any necessary security settings, such as the certificate or truststore.

Check the.network connectivity between the client and server. Make sure that there are no firewalls or other.network-related issues blocking the connection.

Try using a different tunneling service or test it on a device if you haven't yet.

If none of the above solutions work, you might consider checking the log of server and React native App for more details, to see if there is any error message that can help you understand the problem.

It's also worth noting that some hosting providers may not support WebSocket connections over HTTPS, so it's worth checking with them if this is the case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM