aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test
diff options
context:
space:
mode:
authorJulien Barbot <[email protected]>2013-10-29 22:29:01 +0100
committerFredrik Gustafsson <[email protected]>2013-11-06 11:12:11 +0100
commitbc8b6bf58c96f8d5a07146ddea145f71fe8c8956 (patch)
treef5d365f8f8ceba7d84b56a50d7a5f9cf06b53d74 /lib/ssl/test
parent0b13c6cbfff58f928778428deb6862a7744416bb (diff)
downloadotp-bc8b6bf58c96f8d5a07146ddea145f71fe8c8956.tar.gz
otp-bc8b6bf58c96f8d5a07146ddea145f71fe8c8956.tar.bz2
otp-bc8b6bf58c96f8d5a07146ddea145f71fe8c8956.zip
Add SSL Server Name Indication (SNI) client support
See RFC 6066 section 3
Diffstat (limited to 'lib/ssl/test')
-rw-r--r--lib/ssl/test/ssl_handshake_SUITE.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ssl/test/ssl_handshake_SUITE.erl b/lib/ssl/test/ssl_handshake_SUITE.erl
index 9695710230..7e8e8d2611 100644
--- a/lib/ssl/test/ssl_handshake_SUITE.erl
+++ b/lib/ssl/test/ssl_handshake_SUITE.erl
@@ -34,7 +34,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() -> [decode_hello_handshake,
decode_single_hello_extension_correctly,
- decode_unknown_hello_extension_correctly].
+ decode_unknown_hello_extension_correctly,
+ encode_single_hello_sni_extension_correctly].
%%--------------------------------------------------------------------
%% Test Cases --------------------------------------------------------
@@ -73,3 +74,12 @@ decode_unknown_hello_extension_correctly(_Config) ->
Extensions = ssl_handshake:decode_hello_extensions(<<FourByteUnknown/binary, Renegotiation/binary>>),
#renegotiation_info{renegotiated_connection = <<0>>}
= Extensions#hello_extensions.renegotiation_info.
+
+encode_single_hello_sni_extension_correctly(_Config) ->
+ Exts = #hello_extensions{sni = #sni{hostname = "test.com"}},
+ SNI = <<16#00, 16#00, 16#00, 16#0d, 16#00, 16#0b, 16#00, 16#00, 16#08,
+ $t, $e, $s, $t, $., $c, $o, $m>>,
+ ExtSize = byte_size(SNI),
+ HelloExt = <<ExtSize:16/unsigned-big-integer, SNI/binary>>,
+ Encoded = ssl_handshake:encode_hello_extensions(Exts),
+ HelloExt = Encoded.