diff options
author | Ingela Anderton Andin <[email protected]> | 2012-09-26 12:07:52 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2012-10-01 15:15:10 +0200 |
commit | 6f0bbf80a7ddbe6c416b4d44b7f2443b415909bf (patch) | |
tree | d4c63cbbc22c82a56e54c3a758390f70641036b2 /lib/ssl/test | |
parent | 3ea4a5934c104aada07a8c971c0a2fd74d1e26f8 (diff) | |
download | otp-6f0bbf80a7ddbe6c416b4d44b7f2443b415909bf.tar.gz otp-6f0bbf80a7ddbe6c416b4d44b7f2443b415909bf.tar.bz2 otp-6f0bbf80a7ddbe6c416b4d44b7f2443b415909bf.zip |
ssl: Better test to determine if sslv2 is supported by openssl
Diffstat (limited to 'lib/ssl/test')
-rw-r--r-- | lib/ssl/test/ssl_to_openssl_SUITE.erl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl index 21797bee08..98ef050b14 100644 --- a/lib/ssl/test/ssl_to_openssl_SUITE.erl +++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl @@ -1451,11 +1451,27 @@ check_sane_openssl_renegotaite(Config) -> end. check_sane_openssl_sslv2(Config) -> - case os:cmd("openssl version") of - "OpenSSL 1." ++ _ -> - {skip, "sslv2 by default turned of in 1.*"}; - _ -> - Config + Port = open_port({spawn, "openssl s_client -ssl2 "}, [stderr_to_stdout]), + case supports_sslv2(Port) of + true -> + Config; + false -> + {skip, "sslv2 not supported by openssl"} + end. + +supports_sslv2(Port) -> + receive + {Port, {data, "unknown option -ssl2" ++ _}} -> + false; + {Port, {data, Data}} -> + case lists:member("error", string:tokens(Data, ":")) of + true -> + false; + false -> + supports_sslv2(Port) + end + after 500 -> + true end. check_sane_openssl_version(Version) -> |