| Author |
Message |
< Erlang bugs mailing list ~ badarg in new_ssl ssl_connection with client socket and {pac |
| Guest |
Posted: Wed Jun 23, 2010 9:05 am |
|
|
|
Guest
|
Hi!
The http packet option does not work with new_ssl client sockets.
The ssl_connection process crashes with a badarg when retrieving the http response:
::exit:{{badarg,[{erlang,binary_to_list,[{http_response,{1,1},200,"OK"}]},
{ssl_connection,format_reply,3},
{ssl_connection,format_reply,2},
{ssl_connection,deliver_app_data,4},
{ssl_connection,application_data,2},
{ssl_connection,handle_event,3},
{gen_fsm,handle_msg,7},
{proc_lib,init_p_do_apply,3}]},
{gen_fsm,sync_send_all_state_event,[<0.592.0>,{recv,0},1000]}}
in function gen_fsm:sync_send_all_state_event/3
in call from ssl_connection:sync_send_all_state_event/3
Erlang version: R13B04 (no fix mentioned in in the release notes of R14A).
How to repeat:
* ssl:connect to a http server
* ssl:send a http request string
* call ssl:recv on the socket
Trace that shows the calls:
(<0.592.0>) call ssl:connect("localhost",10000,[{ssl_imp,new},{packet,http},{active,false}])
(<0.592.0>) returned from ssl:connect/3 -> {ok,{sslsocket,new_ssl,<0.594.0>}}
(<0.592.0>) call ssl:send({sslsocket,new_ssl,<0.594.0>},"GET / HTTP/1.1\r\n\r\n")
(<0.592.0>) returned from ssl:send/2 -> ok
(<0.592.0>) call ssl:recv({sslsocket,new_ssl,<0.594.0>},0,1000)
(<0.592.0>) exception_from {ssl,recv,3} {exit,{{badarg,[{erlang,binary_to_list,[{http_response,{1,1},200,"OK"}]},
{ssl_connection,format_reply,3},
{ssl_connection,format_reply,2},
{ssl_connection,deliver_app_data,4},
{ssl_connection,application_data,2},
{ssl_connection,handle_event,3},
{gen_fsm,handle_msg,7},
{proc_lib,init_p_do_apply,3}]},
{gen_fsm,sync_send_all_state_event,[<0.594.0>,{recv,0},1000]}}}
/Jonas
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
www.erlang-solutions.com
________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
www.erlang-solutions.com
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Jun 23, 2010 1:42 pm |
|
|
|
Guest
|
Hi!
This was fixed in ssl-3.11.1.
From release notes: (Second part is the relevant one).
"Alert handling has been improved to better handle unexpected but valid
messages and the implementation is also changed to avoid timing related
issues that could cause different error messages depending on network
latency. Packet handling was sort of broken but would mostly work as
expected when socket was in binary mode. This has now been fixed. Own
Id: OTP-8588"
Although the patch ssl-3.11.1 on R13B has not been released as no one
requested it. We just want to have a ssl version on R13B that is as
close as possible to
ssl-4.0 (if someone needs it) .
Regards Ingela Erlang/OTP team - Ericsson AB
Jonas Boberg wrote:
> Hi!
>
> The http packet option does not work with new_ssl client sockets.
> The ssl_connection process crashes with a badarg when retrieving the http response:
> ::exit:{{badarg,[{erlang,binary_to_list,[{http_response,{1,1},200,"OK"}]},
> {ssl_connection,format_reply,3},
> {ssl_connection,format_reply,2},
> {ssl_connection,deliver_app_data,4},
> {ssl_connection,application_data,2},
> {ssl_connection,handle_event,3},
> {gen_fsm,handle_msg,7},
> {proc_lib,init_p_do_apply,3}]},
> {gen_fsm,sync_send_all_state_event,[<0.592.0>,{recv,0},1000]}}
> in function gen_fsm:sync_send_all_state_event/3
> in call from ssl_connection:sync_send_all_state_event/3
>
> Erlang version: R13B04 (no fix mentioned in in the release notes of R14A).
>
> How to repeat:
> * ssl:connect to a http server
> * ssl:send a http request string
> * call ssl:recv on the socket
>
> Trace that shows the calls:
> (<0.592.0>) call ssl:connect("localhost",10000,[{ssl_imp,new},{packet,http},{active,false}])
> (<0.592.0>) returned from ssl:connect/3 -> {ok,{sslsocket,new_ssl,<0.594.0>}}
>
> (<0.592.0>) call ssl:send({sslsocket,new_ssl,<0.594.0>},"GET / HTTP/1.1\r\n\r\n")
> (<0.592.0>) returned from ssl:send/2 -> ok
>
> (<0.592.0>) call ssl:recv({sslsocket,new_ssl,<0.594.0>},0,1000)
>
> (<0.592.0>) exception_from {ssl,recv,3} {exit,{{badarg,[{erlang,binary_to_list,[{http_response,{1,1},200,"OK"}]},
> {ssl_connection,format_reply,3},
> {ssl_connection,format_reply,2},
> {ssl_connection,deliver_app_data,4},
> {ssl_connection,application_data,2},
> {ssl_connection,handle_event,3},
> {gen_fsm,handle_msg,7},
> {proc_lib,init_p_do_apply,3}]},
> {gen_fsm,sync_send_all_state_event,[<0.594.0>,{recv,0},1000]}}}
>
>
> /Jonas
> ---------------------------------------------------
>
> ---------------------------------------------------
>
> WE'VE CHANGED NAMES!
>
> Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
>
> www.erlang-solutions.com
>
>
> ________________________________________________________________
> erlang-bugs (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org
>
>
________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org
Post received from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|