diff options
author | Ingela Anderton Andin <[email protected]> | 2014-08-14 12:09:53 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-08-14 12:09:53 +0200 |
commit | 3f44d30fea3b0c42c523d4dd60be58b09efe8c1f (patch) | |
tree | 5ec74b3a78504a4ec0650a498f07678d1139222e /lib/ssl/test/ssl_test_lib.erl | |
parent | 9de7cc7f881b5df18d0a26f7d37af164bc0c390e (diff) | |
parent | bd496c144e47c10c900c58cd2d9f38a01e9303cf (diff) | |
download | otp-3f44d30fea3b0c42c523d4dd60be58b09efe8c1f.tar.gz otp-3f44d30fea3b0c42c523d4dd60be58b09efe8c1f.tar.bz2 otp-3f44d30fea3b0c42c523d4dd60be58b09efe8c1f.zip |
Merge branch 'ia/ssl/certificate_types/certificate_requests/OTP-12026' into maint
* ia/ssl/certificate_types/certificate_requests/OTP-12026:
public_key: Updated User Guide with ECC records
ssl: Make sure the correct ROOT-cert is used
ssl: Test ECDSA and improve test suite maintainability
public_key: Correct ASN1-type EcpkParameters in PEM handling
public_key: Correct ASN-1 spec
ssl: Correct handling of certificate_types in Certificate Requests
Diffstat (limited to 'lib/ssl/test/ssl_test_lib.erl')
-rw-r--r-- | lib/ssl/test/ssl_test_lib.erl | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index 150b5037d7..74d71263de 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -450,7 +450,7 @@ make_ecdsa_cert(Config) -> {cacertfile, ServerCaCertFile}, {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]}, {server_ecdsa_verify_opts, [{ssl_imp, new},{reuseaddr, true}, - {cacertfile, ClientCaCertFile}, + {cacertfile, ServerCaCertFile}, {certfile, ServerCertFile}, {keyfile, ServerKeyFile}, {verify, verify_peer}]}, {client_ecdsa_opts, [{ssl_imp, new},{reuseaddr, true}, @@ -475,7 +475,7 @@ make_ecdh_rsa_cert(Config) -> {cacertfile, ServerCaCertFile}, {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]}, {server_ecdh_rsa_verify_opts, [{ssl_imp, new},{reuseaddr, true}, - {cacertfile, ClientCaCertFile}, + {cacertfile, ServerCaCertFile}, {certfile, ServerCertFile}, {keyfile, ServerKeyFile}, {verify, verify_peer}]}, {client_ecdh_rsa_opts, [{ssl_imp, new},{reuseaddr, true}, @@ -1136,3 +1136,36 @@ filter_suites(Ciphers0) -> Supported1 = ssl_cipher:filter_suites(Supported0), Supported2 = [ssl:suite_definition(S) || S <- Supported1], [Cipher || Cipher <- Ciphers0, lists:member(Cipher, Supported2)]. + +-define(OPENSSL_QUIT, "Q\n"). +close_port(Port) -> + catch port_command(Port, ?OPENSSL_QUIT), + close_loop(Port, 500, false). + +close_loop(Port, Time, SentClose) -> + receive + {Port, {data,Debug}} when is_port(Port) -> + ct:log("openssl ~s~n",[Debug]), + close_loop(Port, Time, SentClose); + {ssl,_,Msg} -> + ct:log("ssl Msg ~s~n",[Msg]), + close_loop(Port, Time, SentClose); + {Port, closed} -> + ct:log("Port Closed~n",[]), + ok; + {'EXIT', Port, Reason} -> + ct:log("Port Closed ~p~n",[Reason]), + ok; + Msg -> + ct:log("Port Msg ~p~n",[Msg]), + close_loop(Port, Time, SentClose) + after Time -> + case SentClose of + false -> + ct:log("Closing port ~n",[]), + catch erlang:port_close(Port), + close_loop(Port, Time, true); + true -> + ct:log("Timeout~n",[]) + end + end. |