diff options
author | Ingela Anderton Andin <[email protected]> | 2019-05-29 22:53:01 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2019-06-05 11:51:48 +0200 |
commit | 9fdfaa533a131aa1b6b73accf739bdf23be84fb6 (patch) | |
tree | 28c15447e71e4c2bb29d1f0137146942806b68c1 | |
parent | abbe8d424676a473bcebdf3b97996ac7a5a70f16 (diff) | |
download | otp-9fdfaa533a131aa1b6b73accf739bdf23be84fb6.tar.gz otp-9fdfaa533a131aa1b6b73accf739bdf23be84fb6.tar.bz2 otp-9fdfaa533a131aa1b6b73accf739bdf23be84fb6.zip |
ssl: Fix broken return value
-rw-r--r-- | lib/ssl/src/ssl_connection.erl | 8 | ||||
-rw-r--r-- | lib/ssl/test/ssl_test_lib.erl | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index a5f754d2e3..6deb355b8e 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -124,7 +124,7 @@ handshake(#sslsocket{pid = [Pid|_]} = Socket, Timeout) -> connected -> {ok, Socket}; {ok, Ext} -> - {ok, Socket, Ext}; + {ok, Socket, no_records(Ext)}; Error -> Error end. @@ -709,6 +709,7 @@ handle_session(#server_hello{cipher_suite = CipherSuite, {ExpectNPN, Protocol} = case Protocol0 of undefined -> + {false, CurrentProtocol}; _ -> {ProtoExt =:= npn, Protocol0} @@ -3000,3 +3001,8 @@ new_emulated([], EmOpts) -> EmOpts; new_emulated(NewEmOpts, _) -> NewEmOpts. + +no_records(Extensions) -> + maps:map(fun(_, Value) -> + ssl_handshake:extension_value(Value) + end, Extensions). diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index 3b161a0c8a..070093190c 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -159,6 +159,7 @@ connect(ListenSocket, Node, N, _, Timeout, SslOpts, [_|_] =ContOpts) -> case ssl:handshake(AcceptSocket, SslOpts, Timeout) of {ok, Socket0, Ext} -> + [_|_] = maps:get(sni, Ext), ct:log("Ext ~p:~n", [Ext]), ct:log("~p:~p~nssl:handshake_continue(~p,~p,~p)~n", [?MODULE,?LINE, Socket0, ContOpts,Timeout]), case ssl:handshake_continue(Socket0, ContOpts, Timeout) of |