From c694ef2b5e96a69eefd215a65667a03fade1e32e Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Fri, 19 Aug 2016 10:47:21 +0200 Subject: ssl, dtls: Refactor sni handling --- lib/ssl/src/dtls_connection.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/ssl/src/dtls_connection.erl') diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl index da7c61cef0..c02cf51a9a 100644 --- a/lib/ssl/src/dtls_connection.erl +++ b/lib/ssl/src/dtls_connection.erl @@ -44,7 +44,8 @@ %% Handshake handling -export([renegotiate/2, reinit_handshake_data/1, - send_handshake/2, queue_handshake/2, queue_change_cipher/2]). + send_handshake/2, queue_handshake/2, queue_change_cipher/2, + select_sni_extension/1]). %% Alert and close handling -export([send_alert/2, close/5]). @@ -147,6 +148,11 @@ reinit_handshake_data(#state{protocol_buffers = Buffers} = State) -> Buffers#protocol_buffers{dtls_fragment_state = dtls_handshake:dtls_handshake_new_flight(0)}}. +select_sni_extension(#client_hello{extensions = HelloExtensions}) -> + HelloExtensions#hello_extensions.sni; +select_sni_extension(_) -> + undefined. + %%==================================================================== %% tls_connection_sup API %%==================================================================== -- cgit v1.2.3