aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_connection.erl
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2019-07-22 11:31:24 +0200
committerPéter Dimitrov <[email protected]>2019-07-22 11:31:24 +0200
commit993139cdbe67523027aa69ec8542d32dd99d4b77 (patch)
treed1627b416829b2a0bb8b6b66e1d14938e4ec0282 /lib/ssl/src/ssl_connection.erl
parent50d781793027157fc3a8ebf24c7bd7610c2752a7 (diff)
parent9ac121ae7a077695f19f7a370210575d9dbbb9bd (diff)
downloadotp-993139cdbe67523027aa69ec8542d32dd99d4b77.tar.gz
otp-993139cdbe67523027aa69ec8542d32dd99d4b77.tar.bz2
otp-993139cdbe67523027aa69ec8542d32dd99d4b77.zip
Merge branch 'peterdmv/ssl/fix-tls13-alpn' into maint
* peterdmv/ssl/fix-tls13-alpn: ssl: Fix handling of ALPN in TLS 1.3
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r--lib/ssl/src/ssl_connection.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index de12de646c..2483509228 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -1275,10 +1275,17 @@ connection({call, From}, {connection_information, false}, State, _) ->
Info = connection_info(State),
hibernate_after(?FUNCTION_NAME, State, [{reply, From, {ok, Info}}]);
connection({call, From}, negotiated_protocol,
- #state{handshake_env = #handshake_env{negotiated_protocol = undefined}} = State, _) ->
+ #state{handshake_env = #handshake_env{alpn = undefined,
+ negotiated_protocol = undefined}} = State, _) ->
hibernate_after(?FUNCTION_NAME, State, [{reply, From, {error, protocol_not_negotiated}}]);
connection({call, From}, negotiated_protocol,
- #state{handshake_env = #handshake_env{negotiated_protocol = SelectedProtocol}} = State, _) ->
+ #state{handshake_env = #handshake_env{alpn = undefined,
+ negotiated_protocol = SelectedProtocol}} = State, _) ->
+ hibernate_after(?FUNCTION_NAME, State,
+ [{reply, From, {ok, SelectedProtocol}}]);
+connection({call, From}, negotiated_protocol,
+ #state{handshake_env = #handshake_env{alpn = SelectedProtocol,
+ negotiated_protocol = undefined}} = State, _) ->
hibernate_after(?FUNCTION_NAME, State,
[{reply, From, {ok, SelectedProtocol}}]);
connection({call, From}, Msg, State, Connection) ->