[erlang-bugs] ssl:negotiated_next_protocol/1 client bug?

Loïc Hoguin essen@REDACTED
Fri Feb 21 21:05:59 CET 2014


Hello,

Do you have any update on this? Twitter doesn't work at all anymore with 
the SPDY client because it seems that it just picks the first protocol 
in its list of available protocols and for Twitter that's an HTTP/2.0 
draft...

Any chance NPN can be fixed for R17? (Or did I miss something perhaps?)

Thanks.

On 08/23/2013 04:19 PM, Ingela Anderton Andin wrote:
> Hi Loic!
>
>
> Loïc Hoguin wrote:
>> Hello,
>>
>> I can't get ssl:negotiated_next_protocol/1 to work from the client
>> side. As a result I can't really know what protocol to use once the
>> connection is established.
>>
>> Example:
>>
>> 1> ssl:start().
>> ok
>> 2> {ok, S} = ssl:connect("twitter.com", 443, [binary, {active, false},
>> {client_preferred_next_protocols, client, [<<"spdy/3">>,
>> <<"http/1.1">>], <<"http/1.1">>}]).
>> {ok,{sslsocket,{gen_tcp,#Port<0.1088>},<0.52.0>}}
>> 3> ssl:negotiated_next_protocol(S).
>> {error,next_protocol_not_negotiated}
>>
>> It says that the protocol hasn't been negotiated. But it actually has
>> been as can be demonstrated below.
>>
>> 4> ssl:send(S, [<<128,3,0,1,1,0,0,81,0,0,0,1,0,0,0,0,0,0>>,
>> 4>
>> [<<120,187,227,198,167,194,2,101,37,80,122,180,66,164,90,119,215,16,176,72,
>>
>> 4>
>> 49,176,236,203,5,23,144,25,37,37,5,160,244,203,106,5,45,54,184,75,202,51,
>> 4>
>> 75,128,113,163,151,12,46,77,88,173,10,18,193,229,24,163,62,40,65,91,97,
>> 4>     73,220,0,0,0,0,255,255>>]]).
>> ok
>> 5> ssl:recv(S, 0).
>> {ok,<<128,3,0,4,0,0,0,12,0,0,0,1,0,0,0,4,0,0,0,100>>}
>>
>> This is SPDY working just fine.
>>
>> The same can be done against an Erlang server that uses
>> ssl:negotiated_next_protocol/1 where it works, it only fails on the
>> client side.
>>
>> Bug?
>>
>
> Sounds like it, but I have not had time to check yet. I will as soon as
> possible but I am a little busy at the moment.
>
>
> Ingela Erlang OTP/Team - Ericsson AB
>

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-bugs mailing list