-
Notifications
You must be signed in to change notification settings - Fork 128
WS Secure server: CFNetwork SSLHandshake failed (-9806) #60
Comments
@micamo2k17 how did you manage to add your self-signed certificate authority to the system's keychain? |
Hi @kisileno , I didn't add my certificate to the keychain, i did the following (sorry for the poor-to-inexistent error-handling):
Probably something wrong with it...? Thanks |
I did something very similar and received the same error when trying to connect from Chrome to the WebSocket server on my iPhone. It turned out that Chrome was aborting the TLS handshake, since it was a self-signed certificate (the CN matched the IP of my iPhone though). To test this, I tried to access the WebSocket via https://... and then accepted the certificate warning, after that the WebSocket connection worked like a charm. On Firefox this did not work. I do not know if there is a solution to this, it looks like current browsers do not allow to handle untrusted WebSocket connections. |
So from what I understand, this seems an issue related to the invalid certificate. |
Hello ! I have same issue only with the client ! EDIT : I find the solution for my problem, I add evaluateServerTrust delegate and return true if it's my CA ! |
Hi,
I'm having problems configuring a secure websocket server with PocketSocket.
The situation is the following: my app creates a websocket server listening on localhost, using a self-signed certificate I made with localhost as CN. The server is created without problems.
Another part of my app tries to connect to this websocket server from a webview. Unfortunately, when this happens, the error "CFNetwork SSLHandshake failed (-9806)" gets printed on the console, and the websocket isn't opened.
If the websocket is created without a certificate, an un-secure connection can be correctly created, but this isn't enough for my use case.
I tried adding the following parameter:
opts[(__bridge id)kCFStreamSSLLevel] = (__bridge id _Nullable)(kCFStreamSocketSecurityLevelSSLv2);
inside the
- (void)accept:(CFSocketNativeHandle)handle
method ofPSWebSocketServer
class, but this seems ineffective.Also tried to disable App Transport Security in my app, and to allow exceptions such as
NSTemporaryExceptionMinimumTLSVersion
to it for the domains interested in this process (localhost, and the one the page in the webview is loaded from), with no success.Do you have and idea about why the SSL handshake with the websocket server may fail?
Thanks!
The text was updated successfully, but these errors were encountered: