Hello,
I was trying to connect to my wss server using socket.io 2.3.1. Everything works fine on iOS and web build but not on Android build. This is the log from console :
D/WebSocket.cpp: WARNING: CA Root file isn’t set. SSL connection will not peer server certificate
D/WebSocket.cpp: NOTICE: Creating Vhost ‘default’ port -1, 1 protocols, IPv6 on
D/WebSocket.cpp: NOTICE: created client ssl context for default
D/WebSocket.cpp: NOTICE: lws_client_connect_2: 0x7a1215b900: address xxx
D/WebSocket.cpp: NOTICE: uplevelling AF_INET to AF_INET6
D/WebSocket.cpp: WebSocket (0x7a2ad78280) Unhandled websocket event: 32
D/WebSocket.cpp: WebSocket (0x7a2ad78280) Unhandled websocket event: 29
D/jswrapper: XMLHttpRequest_finalize, 0x7a16a37d80 …
D/WebSocket.cpp: NOTICE: lws_client_connect_2: 0x7a1215b900: address xxx
D/WebSocket.cpp: NOTICE: uplevelling AF_INET to AF_INET6
D/WebSocket.cpp: WebSocket (0x7a2ad78280) Unhandled websocket event: 58
D/WebSocket.cpp: ERR: SSL error: unable to get local issuer certificate (preverify_ok=0;err=20;depth=1)
D/WebSocket.cpp: ERR: SSL connect error 337047686: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
D/WebSocket.cpp: WebSocket (0x7a2ad78280) onConnectionError, state: 0 …
D/WebSocket.cpp: WebSocket (0x7a2ad78280) onConnectionClosed, state: 2 …
D/WebSocket.cpp: onConnectionClosed, WebSocket (0x7a2ad78280) is closing by server.
D/WebSocket.cpp: WebSocket (0x7a2ad78280) onConnectionClosed DONE!
I tried to provide a certificate to ‘ca’ key but still does not work. Please help
sorry I can’t give you more detail about URL because it will contain internal token. I tried to make a sample project but can’t make it work on any platform SocketIOSample.zip (609.2 KB)
please take a look! I’m very appreciate
This is an error on the certificate validation .
You can use the openssl tool to test if the ca file is working.
By the way, my local test verified that Android is able to connect to the socket.
Hello, it’s me again. Did you create a socket server local to test this? I follow official tutorial on socket.io to make a socket server local for testing but still cannot connect
Finally, I’ve reproduced this problem on my test socket server on heroku. Plz take a look at it. Thanks
problem recap: I cannot connect to my socketio server using socketio client 2.3.0. It works on chrome browser but when I build project to android native app then it cannot connect. sample.zip (3.7 MB)
hi, I have to create a build template for android and put the file cacert.pem into it
then I edit WebSocket-libwebsockets.cpp inside editor folder CocosDashboard_1.0.20\resources.editors\Creator\3.4.1\resources\resources\3d\engine-native\cocos\network like this: