diff options
author | Ingela Anderton Andin <[email protected]> | 2013-03-06 10:04:21 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-03-06 10:04:21 +0100 |
commit | 5086c3eea85e1c4cb7e9463c4ca919a32e3cb21c (patch) | |
tree | 35bbdd3b393073881eeaf540ca84414e1caaed6a /lib/ssl/test | |
parent | de50f9f12168325270b67e59782c10f91462a451 (diff) | |
parent | 5f6d51e05ebe72b9beee17595218aa768464abfa (diff) | |
download | otp-5086c3eea85e1c4cb7e9463c4ca919a32e3cb21c.tar.gz otp-5086c3eea85e1c4cb7e9463c4ca919a32e3cb21c.tar.bz2 otp-5086c3eea85e1c4cb7e9463c4ca919a32e3cb21c.zip |
Merge branch 'ia/ssl/versions-option' into maint
* ia/ssl/versions-option:
ssl: Clean code thanks to dialyzer
ssl: Check that negotiated version is a supported version.
Diffstat (limited to 'lib/ssl/test')
-rw-r--r-- | lib/ssl/test/ssl_basic_SUITE.erl | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index fafd97f839..6b8f226a77 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -126,7 +126,8 @@ api_tests() -> hibernate, listen_socket, ssl_accept_timeout, - ssl_recv_timeout + ssl_recv_timeout, + versions_option ]. session_tests() -> @@ -2659,6 +2660,42 @@ session_cache_process_mnesia(Config) when is_list(Config) -> session_cache_process(mnesia,Config). %%-------------------------------------------------------------------- + +versions_option() -> + [{doc,"Test API versions option to connect/listen."}]. +versions_option(Config) when is_list(Config) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + + Supported = proplists:get_value(supported, ssl:versions()), + Available = proplists:get_value(available, ssl:versions()), + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), + Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0}, + {from, self()}, + {mfa, {ssl_test_lib, send_recv_result_active, []}}, + {options, [{versions, Supported} | ServerOpts]}]), + Port = ssl_test_lib:inet_port(Server), + + Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {mfa, {ssl_test_lib, send_recv_result_active, []}}, + {options, ClientOpts}]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + Server ! listen, + + ErrClient = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port}, + {host, Hostname}, + {from, self()}, + {options, [{versions , Available -- Supported} | ClientOpts]}]), + receive + {Server, _} -> + ok + end, + + ssl_test_lib:check_result(ErrClient, {error, {tls_alert, "protocol version"}}). +%%-------------------------------------------------------------------- %% Internal functions ------------------------------------------------ %%-------------------------------------------------------------------- send_recv_result(Socket) -> |