diff options
author | Péter Dimitrov <[email protected]> | 2019-03-01 15:40:01 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2019-03-04 16:24:54 +0100 |
commit | 372ea8b13a9ccbd9833813838ad3cd1635d3fb5b (patch) | |
tree | f504e374f072e06bd46b34e9ebf32ae6a5705ea4 /lib/ssl | |
parent | 2daeee7aea9af5b403ac7557b8f20a4f34bc6b61 (diff) | |
download | otp-372ea8b13a9ccbd9833813838ad3cd1635d3fb5b.tar.gz otp-372ea8b13a9ccbd9833813838ad3cd1635d3fb5b.tar.bz2 otp-372ea8b13a9ccbd9833813838ad3cd1635d3fb5b.zip |
ssl: Test client authentication with certificate
Change-Id: I09c0501ea790941001b11a3f6d12a96f18da2bea
Diffstat (limited to 'lib/ssl')
-rw-r--r-- | lib/ssl/test/ssl_basic_SUITE.erl | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl index 5d5c23ca2c..630b935599 100644 --- a/lib/ssl/test/ssl_basic_SUITE.erl +++ b/lib/ssl/test/ssl_basic_SUITE.erl @@ -283,7 +283,8 @@ tls13_test_group() -> tls13_custom_groups_ssl_server_openssl_client, tls13_hello_retry_request_ssl_server_openssl_client, tls13_client_auth_empty_cert_alert_ssl_server_openssl_client, - tls13_client_auth_empty_cert_ssl_server_openssl_client]. + tls13_client_auth_empty_cert_ssl_server_openssl_client, + tls13_client_auth_ssl_server_openssl_client]. %%-------------------------------------------------------------------- init_per_suite(Config0) -> @@ -5651,6 +5652,32 @@ tls13_client_auth_empty_cert_ssl_server_openssl_client(Config) -> ssl_test_lib:close_port(Client). +tls13_client_auth_ssl_server_openssl_client() -> + [{doc,"TLS 1.3: Test client authentication."}]. + +tls13_client_auth_ssl_server_openssl_client(Config) -> + ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config), + + ServerOpts0 = ssl_test_lib:ssl_options(server_rsa_opts, Config), + %% Set versions + ServerOpts = [{versions, ['tlsv1.2','tlsv1.3']}, + {verify, verify_peer}, + {fail_if_no_peer_cert, true}|ServerOpts0], + {_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, ServerOpts}]), + Port = ssl_test_lib:inet_port(Server), + + Client = ssl_test_lib:start_basic_client(openssl, 'tlsv1.3', Port, ClientOpts), + + ssl_test_lib:check_result(Server, ok), + ssl_test_lib:close(Server), + ssl_test_lib:close_port(Client). + + %%-------------------------------------------------------------------- %% Internal functions ------------------------------------------------ %%-------------------------------------------------------------------- |