cmullaparthi / ibrowse

Erlang HTTP client
Other
516 stars 190 forks source link

tls_alert internal error #160

Closed teamon closed 6 years ago

teamon commented 6 years ago

I went to update ibrowse from 4.2 to 4.4 and got this difference in behaviour:

ibrowse 4.2.2

iex(1)> :ibrowse.send_req('https://httpbin.org/uuid', [], :get)
{:ok, '200', ...}

ibrowse 4.4.0

iex(1)> :ibrowse.send_req('https://httpbin.org/uuid', [], :get)
{:error, {:conn_failed, {:error, {:tls_alert, 'internal error'}}}}
2018-01-31 21:05:49.194 [info] ['TLS', 32, 'client', 58, 32, 73, 110, 32, 115, 116, 97, 116, 101, 32, 'hello', 32, 'received SERVER ALERT: Fatal - Internal Error', 10]

Requests for other URL work fine like e.g. 'https://google.com' work fine on both versions.

What has changed between 4.2 and 4.4 in terms of ssl handling?

```bash λ elixir --version Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Elixir 1.6.0 (compiled with OTP 20) ```
tazjin commented 6 years ago

I ran into this in the context of the issue linked above (hex2nix failing with the same error you posted when connecting to hex.pm).

Using git bisect and this script it seems that the commit that introduced the error is 216f84cf92caebdaa3efc6dfaa8c65766f66e8db.

It's late here and I'll have to continue investigating this tomorrow evening :)

tazjin commented 6 years ago

Opened #163 with a fix for this. There are some test failures on my local machine which I haven't quite figured out, but I'm really overdue for some sleep and it'll have to wait if it fails in CI, too.