-
Notifications
You must be signed in to change notification settings - Fork 341
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
:tls_alert, 'handshake failure', https://www.bbc.co.uk #164
Comments
Sorry for the late reply but I'm pretty sure this is a hackney/erlang SSL issue :/ |
No problem @edgurgel I will open the issue there. Thanks for the reply. |
I ran into a similar issue when trying to hit a service internally at my company. I'm pretty sure something funky is up with our cert chain, but I was able to find a workaround since all my traffic is behind our VPN: HTTPoison.get("https://example.com/", [], [ssl: [{:versions, [:'tlsv1.2']}]])
# or worst case:
HTTPoison.get("https://example.com/", [], [ssl: [{:verify, :verify_none}]]) Hopefully that helps someone. Updated based on a better recommendation |
Thanks! @jondlm Probably saved me few hours :) |
Just for reference - it is better to force TLS v1.2 with |
I would suggest that this issue be re-opened as it's going to become more common as HTTPS endpoints upgrade their supported TLS versions. I ran into this today with the Slack API. 👍 for @teamon's workaround as it's much better than turning off SSL verification completely. |
Cool I will leave this open so people can jump in here if the README is not enough. Let's leave it open till Erlang 19 is past |
Neither of @jondlm's suggestions worked for me. Erlang/OTP: 19 I'm going to downgrade to Erlang 18 since that's when this last worked for me. |
@teamon hello =) Could you share some reference about what you said?
I would like to understand more about it. Thank you |
@adrianotadao See elixir-tesla/tesla#35. Basically, when using verify_none you give up host verification which is kind of against the purpose of using SSL at all. The issue here is that there are many TLS versions and erlang have(had) some issues with selecting the correct version and it can be overcome with forcing the usage of TLS 1.2. |
Hi
You will notice that doing directly ssl:connect(Hostname, Port, []) will work. This issue only occurs when upgrading a normal TCP socket.
Hope it helps.
|
Same problem with HTTPoison 0.12, Elixir 1.4.5, Erlang 20 The only difference is that I'm connecting through a proxy server, not directly I applied the fix explained in this post and it worked flawlessly Basically you have to pass the HTTPoison.get("https://hostname", [], [proxy: "http://proxy:port",
ssl: [server_name_indication: 'hostname']]) Note that |
I think the issue can be closed now but that sni option tip really deserves to be documented somewhere. A lot of people may experience the same issue in the future. |
Not recommended but: |
failing to do so results in a cryptic error result {options, {{server_name_indication, "127.0.0.1"}}} See also (thanks to @ntalfer for pointing me in the right direction) edgurgel/httpoison#164 (comment)
Can it be configured via some option in |
Mostly to workaround edgurgel/httpoison#164
I got this error too, with Erlang 20, elixir 1.6,1 |
The same, Erlang 20, elixir 1.5.2 |
As I said earlier, the only way to fix this issue for now is to add in your code the equivalent in Elixir of the maybe_add_sni erlang function. It would look like this:
|
Thanks! @jondlm |
thanks, It's helpful. |
This code is golden and worked for me with no issues
Reference URL: https://elixirforum.com/t/https-handshake-error-fatal-handshake-failure/36877/10 |
Hello,
Sorry I wasn't sure if to post this here or on hackney. I don't know all the ins-and-outs of SSL and I'm using Elixir so guessed this was the right place. If you would like me to move it too or reopen on hackney please let me know.
I am trying to check
https://www.bbc.co.uk
from HTTPoison and receiving:[error] SSL: :hello: ssl_alert.erl:97:Fatal error: handshake failure
With the following tuple returned:
{:error, %HTTPoison.Error{id: nil, reason: {:tls_alert, 'handshake failure'}}}}
I can't see anything wrong with the certificate when using
openssl s_client -connect www.bbc.co.uk:443
:I can provide anymore details that are needed. Its seems to be working in all browsers and via curl. I tested this against a fresh home brew installation of OpenSSL but I am also getting the issue on up to date Debian Jessie Machine.
Not sure how the Erlang TLS/SSL module works but I'm wondering if it is an issue there.
Thanks in advance
The text was updated successfully, but these errors were encountered: