diff options
author | Ingela Anderton Andin <[email protected]> | 2015-11-13 15:07:26 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-11-18 09:10:23 +0100 |
commit | 71390889787b571aa3f13e683d9e2349415f5808 (patch) | |
tree | c2e73bd433785dff261b948cedc52c8aea0f0b1c /lib/ssl/src/tls_connection.erl | |
parent | 68a045f8d649fdd77cc704e39e9e4dc331693a90 (diff) | |
download | otp-71390889787b571aa3f13e683d9e2349415f5808.tar.gz otp-71390889787b571aa3f13e683d9e2349415f5808.tar.bz2 otp-71390889787b571aa3f13e683d9e2349415f5808.zip |
ssl: Client should send the hello message in the lowest version it is willing to support
Refactor highest_protocol_version so that code is symmetrical with lowest_protocol_version. For clarity and possible future use cases of highest_protocol_version/2
Diffstat (limited to 'lib/ssl/src/tls_connection.erl')
-rw-r--r-- | lib/ssl/src/tls_connection.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index 3093508f61..a468c131ce 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -168,9 +168,10 @@ hello(start, #state{host = Host, port = Port, role = client, Cache, CacheCb, Renegotiation, Cert), Version = Hello#client_hello.client_version, + HelloVersion = tls_record:lowest_protocol_version(SslOpts#ssl_options.versions), Handshake0 = ssl_handshake:init_handshake_history(), {BinMsg, ConnectionStates, Handshake} = - encode_handshake(Hello, Version, ConnectionStates0, Handshake0), + encode_handshake(Hello, HelloVersion, ConnectionStates0, Handshake0), Transport:send(Socket, BinMsg), State1 = State0#state{connection_states = ConnectionStates, negotiated_version = Version, %% Requested version |