-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
SSL Handshake failure with certain websites #5723
Comments
Hello @vmeyet, thank you for you report. Since Crystal needs to link with OpenSSL when compiling your script, will be great to know against which version it is linking. A simple test will be run the following command:
And confirm the output. For reference, here is the output of my Ubuntu 16.04 installation: LibSSL::OPENSSL_110 # => false
LibSSL::OPENSSL_102 # => true The ciphers you linked above refers to ciphers used by the server context, but not the ones used by client context (ie. Client should work against any cipher proposed by server, unless specified in your own context. As example, here is a non-HTTP client request: require "socket"
require "openssl"
# nslookup api.hearthstonejson.com
socket = TCPSocket.new("104.27.153.213", 443)
context = OpenSSL::SSL::Context::Client.new
ssl_socket = OpenSSL::SSL::Socket::Client.new(socket, context) And will notice the same failure as your report (using OpenSSL 1.0.2):
And even a direct
Also fails when forcing TLS version and preferred cipher:
So I think the issue might be OpenSSL related than Crystal. Can you perform these debug methods on your end? Thank you. |
Thanks for your answer, launching the code you gave me outputs:
by checking my openssl version, I got
It seems that the system version is 0.9.8zh even though my version is 1.0.2n (as per the .zshrc $PATH resolution). It might be due to this, Crystal is probably using the obsolete version (from I have to do a bit of nasty stuff to symlink the right version in /usr/bin directory. I'll try to see if it resolves this. Also the ruby counterpart is using the right version and that's why it worked:
|
If you're using OSX, you might want to use Homebrew's openssl instead: Look at the Hope that helps. |
the I've added Thanks for you help, I believe this can be closed. Sorry for the hassle due to my (not great) setup. |
When visiting certain websites (https://api.hearthstonejson.com) with tls enabled there is an handshake failure which should NOT be the case, both regular browser (Chrome/Firefox) and the ruby lib
HTTParty
connects perfectly to that website.Errno 14077410 which corresponds to The Destination Site Does Not Like the Cipher
I believe
HTTParty
use the same OpenSSL version than Crystal (which is the system one v1.0.2)Crystal compiler version:
Example of failing code
Stacktrace
Sidenote
I don't believe this is a duplicate of #5266 / #3477. Not the same error code, and connecting to https://maps.googleapis.com works perfectly fine for me
I've performed an sslscan to see the supported cypher and got the following ones:
which seems to be among the ones that are supposedly supported (https://github.com/crystal-lang/crystal/blob/v0.24.1/src/openssl/ssl/context.cr#L13-L54)
The text was updated successfully, but these errors were encountered: