aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-10-04 14:22:06 +0200
committerIngela Anderton Andin <[email protected]>2012-10-04 14:22:06 +0200
commit8bac6930f5611a4def1306504715723303517948 (patch)
tree32191b202b5c2ed255133d00116baacd5ec1d151
parent3ba23ad869bf8e81758d40cee9ddcb545af28aa2 (diff)
parent6f0bbf80a7ddbe6c416b4d44b7f2443b415909bf (diff)
downloadotp-8bac6930f5611a4def1306504715723303517948.tar.gz
otp-8bac6930f5611a4def1306504715723303517948.tar.bz2
otp-8bac6930f5611a4def1306504715723303517948.zip
Merge branch 'ia/ssl/sslv2-test'
* ia/ssl/sslv2-test: ssl: Better test to determine if sslv2 is supported by openssl
-rw-r--r--lib/ssl/test/ssl_to_openssl_SUITE.erl26
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) ->