diff options
author | Ingela Anderton Andin <[email protected]> | 2014-02-17 10:51:06 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-02-17 10:51:06 +0100 |
commit | 656b800e52ebdf71c1a0097270977092c1510147 (patch) | |
tree | eb86e72a085f00e20b34051f55684c9bfa05f7cb /lib/ssl/test/ssl_basic_SUITE.erl | |
parent | a37ea8849ab29cb8d15ab3bc5a3ba1fc16dd0276 (diff) | |
parent | 48c37784676256671382d1199697b6f96228ba8e (diff) | |
download | otp-656b800e52ebdf71c1a0097270977092c1510147.tar.gz otp-656b800e52ebdf71c1a0097270977092c1510147.tar.bz2 otp-656b800e52ebdf71c1a0097270977092c1510147.zip |
Merge branch 'ia/ssl/cipher-version-mismatch/OTP-11712'
* ia/ssl/cipher-version-mismatch/OTP-11712:
ssl: Fix possible mismatch between SSL/TLS version and default ciphers
ssl: Add test for avoiding a version and chipher suite missmatch
Diffstat (limited to 'lib/ssl/test/ssl_basic_SUITE.erl')
-rw-r--r-- | lib/ssl/test/ssl_basic_SUITE.erl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index ddc511c652..2e216b32fa 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -86,6 +86,7 @@ basic_tests() -> [app, alerts, send_close, + version_option, connect_twice, connect_dist, clear_pem_cache @@ -1072,6 +1073,13 @@ send_close(Config) when is_list(Config) -> {error, _} = ssl:send(SslS, "Hello world"). %%-------------------------------------------------------------------- +version_option() -> + [{doc, "Use version option and do no specify ciphers list. Bug specified incorrect ciphers"}]. +version_option(Config) when is_list(Config) -> + Versions = proplists:get_value(supported, ssl:versions()), + [version_option_test(Config, Version) || Version <- Versions]. + +%%-------------------------------------------------------------------- close_transport_accept() -> [{doc,"Tests closing ssl socket when waiting on ssl:transport_accept/1"}]. @@ -3488,3 +3496,28 @@ shutdown_both_result(Socket, client) -> peername_result(S) -> ssl:peername(S). + +version_option_test(Config, Version) -> + ClientOpts = ?config(client_opts, Config), + ServerOpts = ?config(server_opts, Config), + {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, []}}, + {options, [{active, false}, {versions, [Version]}| 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, []}}, + {options, [{active, false}, {versions, [Version]}| ClientOpts]}]), + + ct:log("Testcase ~p, Client ~p Server ~p ~n", + [self(), Client, Server]), + + ssl_test_lib:check_result(Server, ok, Client, ok), + + ssl_test_lib:close(Server), + ssl_test_lib:close(Client). |