Skip to content

Commit

Permalink
OTP-8517 Renegotiation
Browse files Browse the repository at this point in the history
New ssl now properly handles ssl renegotiation, and initiates a
renegotiation if ssl/ltls-sequence numbers comes close to the max value.
  • Loading branch information
IngelaAndin authored and Erlang/OTP committed Apr 13, 2010
1 parent 84f2aeb commit 7e378f5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/ssl/test/ssl_basic_SUITE.erl
Expand Up @@ -2169,18 +2169,22 @@ send_recv_result_active_once(Socket) ->


renegotiate(Socket, Data) ->
[{session_id, Id} | _ ] = ssl:session_info(Socket),
ssl:renegotiate(Socket),
test_server:format("Renegotiating ~n", []),
Result = ssl:renegotiate(Socket),
test_server:format("Result ~p~n", [Result]),
ssl:send(Socket, Data),
test_server:sleep(1000),
case ssl:session_info(Socket) of
[{session_id, Id} | _ ] ->
fail_session_not_renegotiated;
_ ->
ok
case Result of
ok ->
ok;
%% It is not an error in erlang ssl
%% if peer rejects renegotiation.
%% Connection will stay up
{error, renegotiation_rejected} ->
ok;
Other ->
Other
end.


session_cache_process_list(doc) ->
["Test reuse of sessions (short handshake)"];

Expand Down Expand Up @@ -2426,7 +2430,7 @@ erlang_ssl_receive(Socket, Data) ->
ok;
Other ->
test_server:fail({unexpected_message, Other})
after 4000 ->
after ?SLEEP * 3 ->
test_server:fail({did_not_get, Data})
end.

0 comments on commit 7e378f5

Please sign in to comment.