Skip to content
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

no worky for https (1.0.2 5c55565d6c5) #141

Closed
gdamjan opened this issue Dec 3, 2014 · 20 comments
Closed

no worky for https (1.0.2 5c55565d6c5) #141

gdamjan opened this issue Dec 3, 2014 · 20 comments
Labels

Comments

@gdamjan
Copy link
Contributor

gdamjan commented Dec 3, 2014

[damjan@archibald hackney]$ ERL_LIBS=deps:. erl
Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.2  (abort with ^G)
1> hackney:start().
ok
2> hackney:get(<<"https://www.youtube.com">>).

=ERROR REPORT==== 3-Dec-2014::21:43:03 ===
** State machine <0.56.0> terminating 
** Last message in was {tcp,#Port<0.1405>,
            <<22,3,3,0,93,2,0,0,89,3,3,84,127,117,255,229,164,
              135,42,180,132,187,42,245,107,255,74,17,136,211,
              154,235,15,78,119,236,157,108,244,94,255,35,174,
              32,3,29,117,255,244,224,155,155,193,119,40,145,
              222,255,109,99,170,98,47,125,156,147,6,254,84,
              23,135,30,124,29,77,110,192,9,0,0,17,0,0,0,0,
              255,1,0,1,0,0,11,0,4,3,0,1,2,22,3,3,14,78,11,0,
              14,74,0,14,71,0,6,201,48,130,6,197,48,130,5,173,
              160,3,2,1,2,2,8,37,174,101,117,232,1,104,64,48,
              13,6,9,42,134,72,134,247,13,1,1,5,5,0,48,73,49,
              11,48,9,6,3,85,4,6,19,2,85,83,49,19,48,17,6,3,
              85,4,10,19,10,71,111,111,103,108,101,32,73,110,
              99,49,37,48,35,6,3,85,4,3,19,28,71,111,111,103,
              108,101,32,73,110,116,101,114,110,101,116,32,65,
              117,116,104,111,114,105,116,121,32,71,50,48,30,
              23,13,49,52,49,49,50,48,48,57,50,57,49,52,90,23,
              13,49,53,48,50,49,56,48,48,48,48,48,48,90,48,
              102,49,11,48,9,6,3,85,4,6,19,2,85,83,49,19,48,
              17,6,3,85,4,8,12,10,67,97,108,105,102,111,114,
              110,105,97,49,22,48,20,6,3,85,4,7,12,13,77,111,
              117,110,116,97,105,110,32,86,105,101,119,49,19,
              48,17,6,3,85,4,10,12,10,71,111,111,103,108,101,
              32,73,110,99,49,21,48,19,6,3,85,4,3,12,12,42,46,
              103,111,111,103,108,101,46,99,111,109,48,89,48,
              19,6,7,42,134,72,206,61,2,1,6,8,42,134,72,206,
              61,3,1,7,3,66,0,4,239,17,2,30,58,209,122,37,213,
              224,230,99,232,174,177,189,137,205,210,61,217,
              56,170,25,54,178,25,237,226,204,35,216,210,186,
              50,69,44,117,245,182,108,110,144,22,136,1,44,
              223,216,101,244,211,3,91,5,143,64,182,1,108,149,
              202,14,212,163,130,4,93,48,130,4,89,48,29,6,3,
              85,29,37,4,22,48,20,6,8,43,6,1,5,5,7,3,1,6,8,43,
              6,1,5,5,7,3,2,48,130,3,38,6,3,85,29,17,4,130,3,
              29,48,130,3,25,130,12,42,46,103,111,111,103,108,
              101,46,99,111,109,130,13,42,46,97,110,100,114,
              111,105,100,46,99,111,109,130,22,42,46,97,112,
              112,101,110,103,105,110,101,46,103,111,111,103,
              108,101,46,99,111,109,130,18,42,46,99,108,111,
              117,100,46,103,111,111,103,108,101,46,99,111,
              109,130,22,42,46,103,111,111,103,108,101,45,97,
              110,97,108,121,116,105,99,115,46,99,111,109,130,
              11,42,46,103,111,111,103,108,101,46,99,97,130,
              11,42,46,103,111,111,103,108,101,46,99,108,130,
              14,42,46,103,111,111,103,108,101,46,99,111,46,
              105,110,130,14,42,46,103,111,111,103,108,101,46,
              99,111,46,106,112,130,14,42,46,103,111,111,103,
              108,101,46,99,111,46,117,107,130,15,42,46,103,
              111,111,103,108,101,46,99,111,109,46,97,114,130,
              15,42,46,103,111,111,103,108,101,46,99,111,109,
              46,97,117,130,15,42,46,103,111,111,103,108,101,
              46,99,111,109,46,98,114,130,15,42,46,103,111,
              111,103,108,101,46,99,111,109,46,99,111,130,15,
              42,46,103,111,111,103,108,101,46,99,111,109,46,
              109,120,130,15,42,46,103,111,111,103,108,101,46,
              99,111,109,46,116,114,130,15,42,46,103,111,111,
              103,108,101,46,99,111,109,46,118,110,130,11,42,
              46,103,111,111,103,108,101,46,100,101,130,11,42,
              46,103,111,111,103,108,101,46,101,115,130,11,42,
              46,103,111,111,103,108,101,46,102,114,130,11,42,
              46,103,111,111,103,108,101,46,104,117,130,11,42,
              46,103,111,111,103,108,101,46,105,116,130,11,42,
              46,103,111,111,103,108,101,46,110,108,130,11,42,
              46,103,111,111,103,108,101,46,112,108,130,11,42,
              46,103,111,111,103,108,101,46,112,116,130,18,42,
              46,103,111,111,103,108,101,97,100,97,112,105,
              115,46,99,111,109,130,15,42,46,103,111,111,103,
              108,101,97,112,105,115,46,99,110,130,20,42,46,
              103,111,111,103,108,101,99,111,109,109,101,114,
              99,101,46,99,111,109,130,17,42,46,103,111,111,
              103,108,101,118,105,100,101,111,46,99,111,109,
              130,12,42,46,103,115,116,97,116,105,99,46,99,
              110,130,13,42,46,103,115,116,97,116,105,99,46,
              99,111,109,130,10,42,46,103,118,116,49,46,99,
              111,109,130,10,42,46,103,118,116,50,46,99,111,
              109,130,20,42,46,109,101,116,114,105,99,46,103,
              115,116,97,116,105,99,46,99,111,109,130,12,42,
              46,117,114,99,104,105,110,46,99,111,109,130,16,
              42,46,117,114,108,46,103,111,111,103,108,101,46,
              99,111,109,130,22,42,46,121,111,117,116,117,98,
              101,45,110,111,99,111,111,107,105,101,46,99,111,
              109,130,13,42,46,121,111,117,116,117,98,101,46,
              99,111,109,130,22,42,46,121,111,117,116,117,98,
              101,101,100,117,99,97,116,105,111,110,46,99,111,
              109,130,11,42,46,121,116,105,109,103,46,99,111,
              109,130,11,97,110,100,114,111,105,100,46,99,111,
              109,130,4,103,46,99,111,130,6,103,111,111,46,
              103,108,130,20,103,111,111,103,108,101,45,97,
              110,97,108,121,116,105,99,115,46,99,111,109,130,
              10,103,111,111,103,108,101,46,99,111,109,130,18,
              103,111,111,103,108,101,99,111,109,109,101,114,
              99,101,46,99,111,109,130,10,117,114,99,104,105,
              110,46,99,111,109,130,8,121,111,117,116,117,46,
              98,101,130,11,121,111,117,116,117,98,101,46,99,
              111,109,130,20,121,111,117,116,117,98,101,101,
              100,117,99,97,116,105,111,110,46,99,111,109,48,
              11,6,3,85,29,15,4,4,3,2,7,128,48,104,6,8,43,6,1,
              5,5,7,1,1,4,92,48,90,48,43,6,8,43,6,1,5,5,7,48,
              2,134,31,104,116,116,112,58,47,47,112,107,105,
              46,103,111,111,103,108,101,46,99,111,109,47,71,
              73,65,71,50,46,99,114,116,48,43,6,8,43,6,1,5,5,
              7,48,1>>}
** When State == hello
**      Data  == [{data,
          [{"StateData",
            {state,client,
            {#Ref<0.0.0.92>,<0.33.0>},
            gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,
            "www.youtube.com",443,#Port<0.1405>,
            {ssl_options,tls,
                [{3,3},{3,2},{3,1},{3,0}],
                verify_peer,
                {#Fun<ssl_verify_hostname.verify_fun.3>,
                [{check_hostname,"www.youtube.com"}]},
                #Fun<ssl.8.50551058>,false,false,undefined,99,
                <<>>,"***",<<>>,"***","***","***",
                <<"/home/damjan/src/hackney/priv/ca-bundle.crt">>,
                "***",undefined,undefined,"***","***",
                [<<"À$">>,<<"À(">>,<<"À&">>,<<"À*">>,
                <<0,107>>,
                <<0,106>>,
                <<0,61>>,
                <<"À#">>,<<"À'">>,<<"À%">>,<<"À)">>,
                <<0,103>>,
                <<0,64>>,
                <<0,60>>,
                <<"À\n">>,
                <<192,20>>,
                <<0,57>>,
                <<0,56>>,
                <<192,5>>,
                <<192,15>>,
                <<0,53>>,
                <<"À\b">>,
                <<192,18>>,
                <<0,22>>,
                <<0,19>>,
                <<192,3>>,
                <<"À\r">>,
                <<0,10>>,
                <<"À\t">>,
                <<192,19>>,
                <<0,51>>,
                <<0,50>>,
                <<192,4>>,
                <<192,14>>,
                <<0,47>>,
                <<192,7>>,
                <<192,17>>,
                <<0,5>>,
                <<0,4>>,
                <<0,21>>,
                <<192,2>>,
                <<"À\f">>,
                <<0,9>>],
                #Fun<ssl.1.50551058>,true,268435456,false,
                undefined,false,undefined,undefined,true,
                "www.youtube.com",false},
            {socket_options,binary,raw,0,0,false},
            "***","***","***",16400,"***",28691,
            ssl_session_cache,
            {3,3},
            false,undefined,
            {undefined,undefined},
            undefined,undefined,"***","***","***",undefined,
            "***","***","***",20497,#Ref<0.0.0.94>,undefined,
            "***",
            {false,first},
            {<0.33.0>,#Ref<0.0.0.91>},
            #Ref<0.0.0.97>,
            {[],[]},
            false,true,false,false,undefined,undefined,
            undefined}}]}]
** Reason for termination = 
** {{badmatch,<<>>},
[{ssl_handshake,dec_hello_extensions,2,
        [{file,"ssl_handshake.erl"},{line,1737}]},
{ssl_handshake,decode_handshake,3,
        [{file,"ssl_handshake.erl"},{line,926}]},
{tls_handshake,get_tls_handshake_aux,3,
        [{file,"tls_handshake.erl"},{line,155}]},
{tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,433}]},
{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}
** exception exit: {{{badmatch,<<>>},
        [{ssl_handshake,dec_hello_extensions,2,
                [{file,"ssl_handshake.erl"},{line,1737}]},
          {ssl_handshake,decode_handshake,3,
                [{file,"ssl_handshake.erl"},{line,926}]},
          {tls_handshake,get_tls_handshake_aux,3,
                [{file,"tls_handshake.erl"},{line,155}]},
          {tls_connection,next_state,4,
                  [{file,"tls_connection.erl"},{line,433}]},
          {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]},
          {proc_lib,init_p_do_apply,3,
                [{file,"proc_lib.erl"},{line,237}]}]},
        {gen_fsm,sync_send_all_state_event,
            [<0.56.0>,{start,8000},infinity]}}
in function  gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242)
in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, line 1654)
in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101)
in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81)
in call from ssl_connection:connect/8 (ssl_connection.erl, line 71)
in call from hackney_connect:do_connect/5 (src/hackney_connect/hackney_connect.erl, line 241)
in call from hackney_connect:connect/5 (src/hackney_connect/hackney_connect.erl, line 30)
in call from hackney:request/5 (src/hackney_client/hackney.erl, line 309)
@gdamjan
Copy link
Contributor Author

gdamjan commented Dec 3, 2014

Also, on R15

damjan$ ERL_LIBS=deps:. erl
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:24:8] [async-threads:0] [kernel-poll:false]

Eshell V5.9.1  (abort with ^G)
1> hackney:start().
ok
2> hackney:get(<<"https://www.youtube.com">>).
{error,{eoptions,{inet_options,[{server_name_indication,"www.youtube.com"},
                {mode,binary},
                {active,false},
                {packet,raw}]}}}

@benoitc
Copy link
Owner

benoitc commented Dec 3, 2014

Can you try with a more recent version of erlang?

On 17.3.3:

$ erl -pa ebin -pa deps/*/ebin
Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.2  (abort with ^G)
1> hackney:start().
ok
2> hackney:get(<<"https://www.youtube.com">>).
{ok,200,
    [{<<"Date">>,<<"Wed, 03 Dec 2014 20:54:50 GMT">>},
     {<<"Server">>,<<"gwiseguy/2.0">>},
     {<<"Cache-Control">>,<<"no-cache">>},
     {<<"Expires">>,<<"Tue, 27 Apr 1971 19:44:06 EST">>},
     {<<"X-XSS-Protection">>,
      <<"1; mode=block; report=https://www.google.com/appserve/security-bugs/log/yout"...>>},
     {<<"X-Content-Type-Options">>,<<"nosniff">>},
     {<<"X-Frame-Options">>,<<"SAMEORIGIN">>},
     {<<"P3P">>,
      <<"CP=\"This is not a P3P policy! See http://support.google.com/acco"...>>},
     {<<"Content-Type">>,<<"text/html; charset=utf-8">>},
     {<<"Alternate-Protocol">>,<<"443:quic,p=0.02">>},
     {<<"Set-Cookie">>,
      <<"YSC=HyPVLilVsEw; path=/; domain=.youtube.com; HttpOn"...>>},
     {<<"Set-Cookie">>,
      <<"VISITOR_INFO1_LIVE=Bctyai9Av5w; expires=Tue, 04-"...>>},
     {<<"Set-Cookie">>,
      <<"PREF=f1=50000000; expires=Tue, 04-Aug-2015 0"...>>},
     {<<"Transfer-Encoding">>,<<"chunked">>}],
    #Ref<0.0.0.77>}

@gdamjan
Copy link
Contributor Author

gdamjan commented Dec 3, 2014

More recent? This is 17.3 from ArchLinux package, I don't have more recent than that at this moment.
https://www.archlinux.org/packages/community/x86_64/erlang/

@benoitc
Copy link
Owner

benoitc commented Dec 3, 2014

yeah it should be installed from the tag :/ either using kerl or manually. Preety sure you experiment an issue solved there: https://github.com/erlang/otp/releases/tag/OTP-17.3.2

Now, I am not sure what to do. I probably need to check the erlang release to enable/disable that check ... But then it would make ssl less useful. Thoughts?

@gdamjan
Copy link
Contributor Author

gdamjan commented Dec 3, 2014

oh. I'll flag the package for update then. What about on R15? it's no longer supported?

@benoitc
Copy link
Owner

benoitc commented Dec 3, 2014

the issue is that the fix is not part of an "official" release even if tagged....

@benoitc benoitc added the bug label Dec 3, 2014
@benoitc
Copy link
Owner

benoitc commented Dec 3, 2014

So, going to 17.3.4 would do the trick .

After discussing around I don't think the issue is specific to hackney but rather an issue in the SSL application and not related to the validation app imo.

@benoitc
Copy link
Owner

benoitc commented Dec 4, 2014

SO to be clear, on hackney side I have no solutions except reverting the validation check or invite people to use the latest version. I will think more about it today and try to see if there are others alternatives.

@kxepal
Copy link
Contributor

kxepal commented Dec 4, 2014

@benoitc how about the following hack: check for OTP_VERSION file existence, read version from there and check that it <17.3 and >=17.3.2? Something like:

OtpVersion = filename:join([code:root_dir(), "releases",erlang:system_info(otp_release), "OTP_VERSION"]),
case file:read_file(OtpVersion) of
  {ok, FullVersion} ->
    case string:tokens(FullVersion, "-") of  %% ignore rc things
      [Version] -> ok;
      [Version, _Rc] - ok
    end,
    VerInfo = [list_to_integer(T) || T <- string:tokens(Version, ".")],
    case VerInfo of
       [17, 3] -> throw({bad_version, broken_ssl});
       [17, 3, 1] -> throw({bad_version, broken_ssl});
       [17, 3, _] -> ok;
        _ -> ok
    end;
  {error, enoent} -> ok  %% not 17 release series
end

@kxepal
Copy link
Contributor

kxepal commented Dec 4, 2014

Didn't test, but imho such rebar hook may works.

@benoitc
Copy link
Owner

benoitc commented Dec 4, 2014

Hrm cool idea, if we can do it at compile time then we have a solution. Checking the version on each connect would impact the performances.

@kxepal
Copy link
Contributor

kxepal commented Dec 4, 2014

Sure, that's need to do on compile time. Rebar pre_hooks with compile looks the right place for it.

@benoitc
Copy link
Owner

benoitc commented Dec 4, 2014

we need to find the right versions to test though. For example it doesn't work on R15B01 but is on R16B03-1 ...

benoitc added a commit that referenced this issue Dec 5, 2014
Fix the following cases:
- R14/R15 doesn't support the option `server_name_indication`, on these
  platform we only do simple certificate verificaton
- 17 < 17.3.2 has a broken SSL validaton, on these versions we only skip the
  validation.
- R16 and any verson  > 17.3.2 we use hostname SSL validation.

fix #141
@benoitc
Copy link
Owner

benoitc commented Dec 5, 2014

@gdamjan @kxepal I pushed a fix in the branch fix/141 ^^ let me know if it works for you. Also if you can test it under R15 to make sure it also works it would help :)

@kxepal
Copy link
Contributor

kxepal commented Dec 5, 2014

@benoitc AFAIK, only 17.3.0 and 17.3.1 has broken SSL. downgrading to 17.2 is one of the option to solve 17.3 ssl problem.

@gdamjan
Copy link
Contributor Author

gdamjan commented Dec 5, 2014

On R15 (debian)

2> hackney:get(<<"https://www.youtube.com">>).
** exception error: bad argument in an arithmetic expression
in function hackney_connect:do_connect/5 (src/hackney_connect/hackney_connect.erl, line 253)
in call from hackney_connect:connect/5 (src/hackney_connect/hackney_connect.erl, line 39)
in call from hackney:request/5 (src/hackney_client/hackney.erl, line 309)

@kxepal
Copy link
Contributor

kxepal commented Dec 5, 2014

+1 on @gdamjan error for R14B04

@benoitc benoitc closed this as completed in 586ff73 Dec 5, 2014
@gdamjan
Copy link
Contributor Author

gdamjan commented Dec 7, 2014

Archlinux Erlang package just got updated to 17.3.4 but I still get the same error:

[damjan@archibald hackney]$ rebar shell                 
==> hackney (shell)
Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.2  (abort with ^G)
1> hackney:start().
ok
2> hackney:get(<<"https://youtube.com/">>).

=ERROR REPORT==== 7-Dec-2014::10:25:06 ===
** State machine <0.64.0> terminating 
** Last message in was {tcp,#Port<0.14092>,
            <<22,3,3,0,93,2,0,0,89,3,3,84,132,29,30,93,161,62,
              118,104,171,175,196,12,28,34,251,251,150,152,82,
              202,16,103,58,97,9,148,123,5,71,225,53,32,196,
              139,62,96,36,93,140,235,61,173,143,2,19,241,125,
              170,188,142,43,139,90,31,83,14,84,82,0,177,212,
              83,46,164,192,9,0,0,17,0,0,0,0,255,1,0,1,0,0,11,
              0,4,3,0,1,2,22,3,3,14,78,11,0,14,74,0,14,71,0,6,
              201,48,130,6,197,48,130,5,173,160,3,2,1,2,2,8,
              37,174,101,117,232,1,104,64,48,13,6,9,42,134,72,
              134,247,13,1,1,5,5,0,48,73,49,11,48,9,6,3,85,4,
              6,19,2,85,83,49,19,48,17,6,3,85,4,10,19,10,71,
              111,111,103,108,101,32,73,110,99,49,37,48,35,6,
              3,85,4,3,19,28,71,111,111,103,108,101,32,73,110,
              116,101,114,110,101,116,32,65,117,116,104,111,
              114,105,116,121,32,71,50,48,30,23,13,49,52,49,
              49,50,48,48,57,50,57,49,52,90,23,13,49,53,48,50,
              49,56,48,48,48,48,48,48,90,48,102,49,11,48,9,6,
              3,85,4,6,19,2,85,83,49,19,48,17,6,3,85,4,8,12,
              10,67,97,108,105,102,111,114,110,105,97,49,22,
              48,20,6,3,85,4,7,12,13,77,111,117,110,116,97,
              105,110,32,86,105,101,119,49,19,48,17,6,3,85,4,
              10,12,10,71,111,111,103,108,101,32,73,110,99,49,
              21,48,19,6,3,85,4,3,12,12,42,46,103,111,111,103,
              108,101,46,99,111,109,48,89,48,19,6,7,42,134,72,
              206,61,2,1,6,8,42,134,72,206,61,3,1,7,3,66,0,4,
              239,17,2,30,58,209,122,37,213,224,230,99,232,
              174,177,189,137,205,210,61,217,56,170,25,54,178,
              25,237,226,204,35,216,210,186,50,69,44,117,245,
              182,108,110,144,22,136,1,44,223,216,101,244,211,
              3,91,5,143,64,182,1,108,149,202,14,212,163,130,
              4,93,48,130,4,89,48,29,6,3,85,29,37,4,22,48,20,
              6,8,43,6,1,5,5,7,3,1,6,8,43,6,1,5,5,7,3,2,48,
              130,3,38,6,3,85,29,17,4,130,3,29,48,130,3,25,
              130,12,42,46,103,111,111,103,108,101,46,99,111,
              109,130,13,42,46,97,110,100,114,111,105,100,46,
              99,111,109,130,22,42,46,97,112,112,101,110,103,
              105,110,101,46,103,111,111,103,108,101,46,99,
              111,109,130,18,42,46,99,108,111,117,100,46,103,
              111,111,103,108,101,46,99,111,109,130,22,42,46,
              103,111,111,103,108,101,45,97,110,97,108,121,
              116,105,99,115,46,99,111,109,130,11,42,46,103,
              111,111,103,108,101,46,99,97,130,11,42,46,103,
              111,111,103,108,101,46,99,108,130,14,42,46,103,
              111,111,103,108,101,46,99,111,46,105,110,130,14,
              42,46,103,111,111,103,108,101,46,99,111,46,106,
              112,130,14,42,46,103,111,111,103,108,101,46,99,
              111,46,117,107,130,15,42,46,103,111,111,103,108,
              101,46,99,111,109,46,97,114,130,15,42,46,103,
              111,111,103,108,101,46,99,111,109,46,97,117,130,
              15,42,46,103,111,111,103,108,101,46,99,111,109,
              46,98,114,130,15,42,46,103,111,111,103,108,101,
              46,99,111,109,46,99,111,130,15,42,46,103,111,
              111,103,108,101,46,99,111,109,46,109,120,130,15,
              42,46,103,111,111,103,108,101,46,99,111,109,46,
              116,114,130,15,42,46,103,111,111,103,108,101,46,
              99,111,109,46,118,110,130,11,42,46,103,111,111,
              103,108,101,46,100,101,130,11,42,46,103,111,111,
              103,108,101,46,101,115,130,11,42,46,103,111,111,
              103,108,101,46,102,114,130,11,42,46,103,111,111,
              103,108,101,46,104,117,130,11,42,46,103,111,111,
              103,108,101,46,105,116,130,11,42,46,103,111,111,
              103,108,101,46,110,108,130,11,42,46,103,111,111,
              103,108,101,46,112,108,130,11,42,46,103,111,111,
              103,108,101,46,112,116,130,18,42,46,103,111,111,
              103,108,101,97,100,97,112,105,115,46,99,111,109,
              130,15,42,46,103,111,111,103,108,101,97,112,105,
              115,46,99,110,130,20,42,46,103,111,111,103,108,
              101,99,111,109,109,101,114,99,101,46,99,111,109,
              130,17,42,46,103,111,111,103,108,101,118,105,
              100,101,111,46,99,111,109,130,12,42,46,103,115,
              116,97,116,105,99,46,99,110,130,13,42,46,103,
              115,116,97,116,105,99,46,99,111,109,130,10,42,
              46,103,118,116,49,46,99,111,109,130,10,42,46,
              103,118,116,50,46,99,111,109,130,20,42,46,109,
              101,116,114,105,99,46,103,115,116,97,116,105,99,
              46,99,111,109,130,12,42,46,117,114,99,104,105,
              110,46,99,111,109,130,16,42,46,117,114,108,46,
              103,111,111,103,108,101,46,99,111,109,130,22,42,
              46,121,111,117,116,117,98,101,45,110,111,99,111,
              111,107,105,101,46,99,111,109,130,13,42,46,121,
              111,117,116,117,98,101,46,99,111,109,130,22,42,
              46,121,111,117,116,117,98,101,101,100,117,99,97,
              116,105,111,110,46,99,111,109,130,11,42,46,121,
              116,105,109,103,46,99,111,109,130,11,97,110,100,
              114,111,105,100,46,99,111,109,130,4,103,46,99,
              111,130,6,103,111,111,46,103,108,130,20,103,111,
              111,103,108,101,45,97,110,97,108,121,116,105,99,
              115,46,99,111,109,130,10,103,111,111,103,108,
              101,46,99,111,109,130,18,103,111,111,103,108,
              101,99,111,109,109,101,114,99,101,46,99,111,109,
              130,10,117,114,99,104,105,110,46,99,111,109,130,
              8,121,111,117,116,117,46,98,101,130,11,121,111,
              117,116,117,98,101,46,99,111,109,130,20,121,111,
              117,116,117,98,101,101,100,117,99,97,116,105,
              111,110,46,99,111,109,48,11,6,3,85,29,15,4,4,3,
              2,7,128,48,104,6,8,43,6,1,5,5,7,1,1,4,92,48,90,
              48,43,6,8,43,6,1,5,5,7,48,2,134,31,104,116,116,
              112,58,47,47,112,107,105,46,103,111,111,103,108,
              101,46,99,111,109,47,71,73,65,71,50,46,99,114,
              116,48,43,6,8,43,6,1,5,5,7,48,1>>}
** When State == hello
**      Data  == [{data,
          [{"StateData",
            {state,client,
            {#Ref<0.0.0.325>,<0.43.0>},
            gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,
            "youtube.com",443,#Port<0.14092>,
            {ssl_options,tls,
                [{3,3},{3,2},{3,1},{3,0}],
                verify_peer,
                {#Fun<ssl_verify_hostname.verify_fun.3>,
                [{check_hostname,"youtube.com"}]},
                #Fun<ssl.8.50551058>,false,false,undefined,99,
                <<>>,"***",<<>>,"***","***","***",
                <<"/home/damjan/src/hackney/priv/ca-bundle.crt">>,
                "***",undefined,undefined,"***","***",
                [<<"À$">>,<<"À(">>,<<"À&">>,<<"À*">>,
                <<0,107>>,
                <<0,106>>,
                <<0,61>>,
                <<"À#">>,<<"À'">>,<<"À%">>,<<"À)">>,
                <<0,103>>,
                <<0,64>>,
                <<0,60>>,
                <<"À\n">>,
                <<192,20>>,
                <<0,57>>,
                <<0,56>>,
                <<192,5>>,
                <<192,15>>,
                <<0,53>>,
                <<"À\b">>,
                <<192,18>>,
                <<0,22>>,
                <<0,19>>,
                <<192,3>>,
                <<"À\r">>,
                <<0,10>>,
                <<"À\t">>,
                <<192,19>>,
                <<0,51>>,
                <<0,50>>,
                <<192,4>>,
                <<192,14>>,
                <<0,47>>,
                <<192,7>>,
                <<192,17>>,
                <<0,5>>,
                <<0,4>>,
                <<0,21>>,
                <<192,2>>,
                <<"À\f">>,
                <<0,9>>],
                #Fun<ssl.1.50551058>,true,268435456,false,
                undefined,false,undefined,undefined,true,
                "youtube.com",false},
            {socket_options,binary,raw,0,0,false},
            "***","***","***",20496,"***",32787,
            ssl_session_cache,
            {3,3},
            false,undefined,
            {undefined,undefined},
            undefined,undefined,"***","***","***",undefined,
            "***","***","***",24593,#Ref<0.0.0.327>,undefined,
            "***",
            {false,first},
            {<0.43.0>,#Ref<0.0.0.324>},
            #Ref<0.0.0.330>,
            {[],[]},
            false,true,false,false,undefined,undefined,
            undefined}}]}]
** Reason for termination = 
** {{badmatch,<<>>},
[{ssl_handshake,dec_hello_extensions,2,
        [{file,"ssl_handshake.erl"},{line,1737}]},
{ssl_handshake,decode_handshake,3,
        [{file,"ssl_handshake.erl"},{line,926}]},
{tls_handshake,get_tls_handshake_aux,3,
        [{file,"tls_handshake.erl"},{line,155}]},
{tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,433}]},
{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}
** exception exit: {{{badmatch,<<>>},
        [{ssl_handshake,dec_hello_extensions,2,
                [{file,"ssl_handshake.erl"},{line,1737}]},
          {ssl_handshake,decode_handshake,3,
                [{file,"ssl_handshake.erl"},{line,926}]},
          {tls_handshake,get_tls_handshake_aux,3,
                [{file,"tls_handshake.erl"},{line,155}]},
          {tls_connection,next_state,4,
                  [{file,"tls_connection.erl"},{line,433}]},
          {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]},
          {proc_lib,init_p_do_apply,3,
                [{file,"proc_lib.erl"},{line,237}]}]},
        {gen_fsm,sync_send_all_state_event,
            [<0.64.0>,{start,8000},infinity]}}
in function  gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242)
in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, line 1654)
in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101)
in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81)
in call from ssl_connection:connect/8 (ssl_connection.erl, line 71)
in call from hackney_connect:do_connect/5 (src/hackney_connect/hackney_connect.erl, line 233)
in call from hackney_connect:connect/5 (src/hackney_connect/hackney_connect.erl, line 38)
in call from hackney:request/5 (src/hackney_client/hackney.erl, line 309)

@benoitc
Copy link
Owner

benoitc commented Dec 7, 2014

i don't reproduce it here. Just retried on another machine. Are you sure it
was actually upgraded?

On Sun, Dec 7, 2014 at 10:28 AM, Дамјан Георгиевски <
notifications@github.com> wrote:

Archlinux Erlang package just got updated to 17.3.4 but I still get the
same error:

[damjan@archibald hackney]$ rebar shell
==> hackney (shell)
Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.2 (abort with ^G)
1> hackney:start().
ok
2> hackney:get(<<"https://youtube.com/">>).

=ERROR REPORT==== 7-Dec-2014::10:25:06 ===
** State machine <0.64.0> terminating
** Last message in was {tcp,#Port<0.14092>,
<<22,3,3,0,93,2,0,0,89,3,3,84,132,29,30,93,161,62,
118,104,171,175,196,12,28,34,251,251,150,152,82,
202,16,103,58,97,9,148,123,5,71,225,53,32,196,
139,62,96,36,93,140,235,61,173,143,2,19,241,125,
170,188,142,43,139,90,31,83,14,84,82,0,177,212,
83,46,164,192,9,0,0,17,0,0,0,0,255,1,0,1,0,0,11,
0,4,3,0,1,2,22,3,3,14,78,11,0,14,74,0,14,71,0,6,
201,48,130,6,197,48,130,5,173,160,3,2,1,2,2,8,
37,174,101,117,232,1,104,64,48,13,6,9,42,134,72,
134,247,13,1,1,5,5,0,48,73,49,11,48,9,6,3,85,4,
6,19,2,85,83,49,19,48,17,6,3,85,4,10,19,10,71,
111,111,103,108,101,32,73,110,99,49,37,48,35,6,
3,85,4,3,19,28,71,111,111,103,108,101,32,73,110,
116,101,114,110,101,116,32,65,117,116,104,111,
114,105,116,121,32,71,50,48,30,23,13,49,52,49,
49,50,48,48,57,50,57,49,52,90,23,13,49,53,48,50,
49,56,48,48,48,48,48,48,90,48,102,49,11,48,9,6,
3,85,4,6,19,2,85,83,49,19,48,17,6,3,85,4,8,12,
10,67,97,108,105,102,111,114,110,105,97,49,22,
48,20,6,3,85,4,7,12,13,77,111,117,110,116,97,
105,110,32,86,105,101,119,49,19,48,17,6,3,85,4,
10,12,10,71,111,111,103,108,101,32,73,110,99,49,
21,48,19,6,3,85,4,3,12,12,42,46,103,111,111,103,
108,101,46,99,111,109,48,89,48,19,6,7,42,134,72,
206,61,2,1,6,8,42,134,72,206,61,3,1,7,3,66,0,4,
239,17,2,30,58,209,122,37,213,224,230,99,232,
174,177,189,137,205,210,61,217,56,170,25,54,178,
25,237,226,204,35,216,210,186,50,69,44,117,245,
182,108,110,144,22,136,1,44,223,216,101,244,211,
3,91,5,143,64,182,1,108,149,202,14,212,163,130,
4,93,48,130,4,89,48,29,6,3,85,29,37,4,22,48,20,
6,8,43,6,1,5,5,7,3,1,6,8,43,6,1,5,5,7,3,2,48,
130,3,38,6,3,85,29,17,4,130,3,29,48,130,3,25,
130,12,42,46,103,111,111,103,108,101,46,99,111,
109,130,13,42,46,97,110,100,114,111,105,100,46,
99,111,109,130,22,42,46,97,112,112,101,110,103,
105,110,101,46,103,111,111,103,108,101,46,99,
111,109,130,18,42,46,99,108,111,117,100,46,103,
111,111,103,108,101,46,99,111,109,130,22,42,46,
103,111,111,103,108,101,45,97,110,97,108,121,
116,105,99,115,46,99,111,109,130,11,42,46,103,
111,111,103,108,101,46,99,97,130,11,42,46,103,
111,111,103,108,101,46,99,108,130,14,42,46,103,
111,111,103,108,101,46,99,111,46,105,110,130,14,
42,46,103,111,111,103,108,101,46,99,111,46,106,
112,130,14,42,46,103,111,111,103,108,101,46,99,
111,46,117,107,130,15,42,46,103,111,111,103,108,
101,46,99,111,109,46,97,114,130,15,42,46,103,
111,111,103,108,101,46,99,111,109,46,97,117,130,
15,42,46,103,111,111,103,108,101,46,99,111,109,
46,98,114,130,15,42,46,103,111,111,103,108,101,
46,99,111,109,46,99,111,130,15,42,46,103,111,
111,103,108,101,46,99,111,109,46,109,120,130,15,
42,46,103,111,111,103,108,101,46,99,111,109,46,
116,114,130,15,42,46,103,111,111,103,108,101,46,
99,111,109,46,118,110,130,11,42,46,103,111,111,
103,108,101,46,100,101,130,11,42,46,103,111,111,
103,108,101,46,101,115,130,11,42,46,103,111,111,
103,108,101,46,102,114,130,11,42,46,103,111,111,
103,108,101,46,104,117,130,11,42,46,103,111,111,
103,108,101,46,105,116,130,11,42,46,103,111,111,
103,108,101,46,110,108,130,11,42,46,103,111,111,
103,108,101,46,112,108,130,11,42,46,103,111,111,
103,108,101,46,112,116,130,18,42,46,103,111,111,
103,108,101,97,100,97,112,105,115,46,99,111,109,
130,15,42,46,103,111,111,103,108,101,97,112,105,
115,46,99,110,130,20,42,46,103,111,111,103,108,
101,99,111,109,109,101,114,99,101,46,99,111,109,
130,17,42,46,103,111,111,103,108,101,118,105,
100,101,111,46,99,111,109,130,12,42,46,103,115,
116,97,116,105,99,46,99,110,130,13,42,46,103,
115,116,97,116,105,99,46,99,111,109,130,10,42,
46,103,118,116,49,46,99,111,109,130,10,42,46,
103,118,116,50,46,99,111,109,130,20,42,46,109,
101,116,114,105,99,46,103,115,116,97,116,105,99,
46,99,111,109,130,12,42,46,117,114,99,104,105,
110,46,99,111,109,130,16,42,46,117,114,108,46,
103,111,111,103,108,101,46,99,111,109,130,22,42,
46,121,111,117,116,117,98,101,45,110,111,99,111,
111,107,105,101,46,99,111,109,130,13,42,46,121,
111,117,116,117,98,101,46,99,111,109,130,22,42,
46,121,111,117,116,117,98,101,101,100,117,99,97,
116,105,111,110,46,99,111,109,130,11,42,46,121,
116,105,109,103,46,99,111,109,130,11,97,110,100,
114,111,105,100,46,99,111,109,130,4,103,46,99,
111,130,6,103,111,111,46,103,108,130,20,103,111,
111,103,108,101,45,97,110,97,108,121,116,105,99,
115,46,99,111,109,130,10,103,111,111,103,108,
101,46,99,111,109,130,18,103,111,111,103,108,
101,99,111,109,109,101,114,99,101,46,99,111,109,
130,10,117,114,99,104,105,110,46,99,111,109,130,
8,121,111,117,116,117,46,98,101,130,11,121,111,
117,116,117,98,101,46,99,111,109,130,20,121,111,
117,116,117,98,101,101,100,117,99,97,116,105,
111,110,46,99,111,109,48,11,6,3,85,29,15,4,4,3,
2,7,128,48,104,6,8,43,6,1,5,5,7,1,1,4,92,48,90,
48,43,6,8,43,6,1,5,5,7,48,2,134,31,104,116,116,
112,58,47,47,112,107,105,46,103,111,111,103,108,
101,46,99,111,109,47,71,73,65,71,50,46,99,114,
116,48,43,6,8,43,6,1,5,5,7,48,1>>}
** When State == hello
** Data == [{data,
[{"StateData",
{state,client,
{#Ref<0.0.0.325>,<0.43.0>},
gen_tcp,tls_connection,tcp,tcp_closed,tcp_error,
"youtube.com",443,#Port<0.14092>,
{ssl_options,tls,
[{3,3},{3,2},{3,1},{3,0}],
verify_peer,
{#Fun<ssl_verify_hostname.verify_fun.3>,
[{check_hostname,"youtube.com"}]},
#Fun<ssl.8.50551058>,false,false,undefined,99,
<<>>,"_",<<>>,"","**","_",
<<"/home/damjan/src/hackney/priv/ca-bundle.crt">>,
"
",undefined,undefined,"**","",
[<<"À$">>,<<"À(">>,<<"À&">>,<<"À
">>,
<<0,107>>,
<<0,106>>,
<<0,61>>,
<<"À#">>,<<"À'">>,<<"À%">>,<<"À)">>,
<<0,103>>,
<<0,64>>,
<<0,60>>,
<<"À\n">>,
<<192,20>>,
<<0,57>>,
<<0,56>>,
<<192,5>>,
<<192,15>>,
<<0,53>>,
<<"À\b">>,
<<192,18>>,
<<0,22>>,
<<0,19>>,
<<192,3>>,
<<"À\r">>,
<<0,10>>,
<<"À\t">>,
<<192,19>>,
<<0,51>>,
<<0,50>>,
<<192,4>>,
<<192,14>>,
<<0,47>>,
<<192,7>>,
<<192,17>>,
<<0,5>>,
<<0,4>>,
<<0,21>>,
<<192,2>>,
<<"À\f">>,
<<0,9>>],
#Fun<ssl.1.50551058>,true,268435456,false,
undefined,false,undefined,undefined,true,
"youtube.com",false},
{socket_options,binary,raw,0,0,false},
"
","","",20496,"",32787,
ssl_session_cache,
{3,3},
false,undefined,
{undefined,undefined},
undefined,undefined,"
","","",undefined,
"
","","",24593,#Ref<0.0.0.327>,undefined,
"
",
{false,first},
{<0.43.0>,#Ref<0.0.0.324>},
#Ref<0.0.0.330>,
{[],[]},
false,true,false,false,undefined,undefined,
undefined}}]}]
*
Reason for termination =
** {{badmatch,<<>>},
[{ssl_handshake,dec_hello_extensions,2,
[{file,"ssl_handshake.erl"},{line,1737}]},
{ssl_handshake,decode_handshake,3,
[{file,"ssl_handshake.erl"},{line,926}]},
{tls_handshake,get_tls_handshake_aux,3,
[{file,"tls_handshake.erl"},{line,155}]},
{tls_connection,next_state,4,[{file,"tls_connection.erl"},{line,433}]},
{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}
** exception exit: {{{badmatch,<<>>},
[{ssl_handshake,dec_hello_extensions,2,
[{file,"ssl_handshake.erl"},{line,1737}]},
{ssl_handshake,decode_handshake,3,
[{file,"ssl_handshake.erl"},{line,926}]},
{tls_handshake,get_tls_handshake_aux,3,
[{file,"tls_handshake.erl"},{line,155}]},
{tls_connection,next_state,4,
[{file,"tls_connection.erl"},{line,433}]},
{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,237}]}]},
{gen_fsm,sync_send_all_state_event,
[<0.64.0>,{start,8000},infinity]}}
in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242)
in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, line 1654)
in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101)
in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81)
in call from ssl_connection:connect/8 (ssl_connection.erl, line 71)
in call from hackney_connect:do_connect/5 (src/hackney_connect/hackney_connect.erl, line 233)
in call from hackney_connect:connect/5 (src/hackney_connect/hackney_connect.erl, line 38)
in call from hackney:request/5 (src/hackney_client/hackney.erl, line 309)


Reply to this email directly or view it on GitHub
#141 (comment).

@gdamjan
Copy link
Contributor Author

gdamjan commented Dec 7, 2014

urgh. right, I was using the -nox package and it got synced a bit later. works on 17.3.4

Erlang/OTP 17 [erts-6.2.1] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
1> file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])).
{ok,<<"17.3.4\n">>}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants