-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It cannot connect with SSL certification since last update. #402
Comments
Hey @bluefish625, thanks for the report!
|
Just tested this by running against this public URL: |
Also, if you are using a self-signed certificates or a certificate that doesn't validate - I would recommend trying to enable NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"wss://echo.websocket.org"]];
SRWebSocket *webSocket = [[SRWebSocket alloc] initWithURLRequest:request
protocols:nil
allowsUntrustedSSLCertificates:YES]; |
@nlutsenko We use CA certification and do not allowsUntrustedSSLCertificates.(allowsUntrustedSSLCertificates = NO;) This is my Request:
In my code, we set PinnedCertificates. The @"CA_socketCertificate" is a CA Certificate. |
@nlutsenko If do not call [request setSR_SSLPinnedCertificates:@[certificate]]; (The property of SR_SSLPinnedCertificates is nil). It work perfectly. What's wrong with us? But, In old code, we set SR_SSLPinnedCertificates too. It work well. |
@nlutsenko I think maybe I'm wrong. We use CA certificate. So we should not set pinnedCertificate? |
@nlutsenko Oh, I'm forget to say thanks. Thanks for reply. Thanks very much. |
Aha! That helps a lot! Using pinned certificate is actually a great security measure and you absolutely should continue doing it. Taking into account that #395 added proxy support, the way we open streams actually changed and I bet it needs the same implementation as we have in the base Implementing a fix looks easy, but since it's going to take some time for me to do the setup to validate this, I would recommend either rolling back to the last released version (which is very stable) or looking into |
@nlutsenko Thanks very much. I think rolling back to the last released version is a good choice. |
The fix is actually simpler than I thought. |
It cannot connect with SSL certification since last update.
Last week, We checkout the source code and test it using TestChat project to connect our server through wss://. It's work perfectly!
But, We checkout a new version today. It not work. We merge the source code found it has been changed.
The error code is:
Error Domain=SRWebSocketErrorDomain Code=2133 "Invalid Sec-WebSocket-Accept response." UserInfo={NSLocalizedDescription=Invalid Sec-WebSocket-Accept response.
The text was updated successfully, but these errors were encountered: