aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2017-08-10 09:59:54 +0200
committerIngela Anderton Andin <[email protected]>2017-08-10 09:59:54 +0200
commit2432649120fd413894b5bb60d8ac864f6632e868 (patch)
treebb325e6140d3c236052f72466dcfba98c280fdb0 /lib/ssl
parent0c4a4aa70c5bceb9c38ddc939cfa66f16e943550 (diff)
parent9a71819576f6cf3a89fa516de3f6e58b838cdc94 (diff)
downloadotp-2432649120fd413894b5bb60d8ac864f6632e868.tar.gz
otp-2432649120fd413894b5bb60d8ac864f6632e868.tar.bz2
otp-2432649120fd413894b5bb60d8ac864f6632e868.zip
Merge branch 'ingela/dtls/cuddle' into maint
* ingela/dtls/cuddle: ssl: Handle OpenSSL output correctly
Diffstat (limited to 'lib/ssl')
-rw-r--r--lib/ssl/test/ssl_test_lib.erl33
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index 3b9073ac0b..e61993598e 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -1429,7 +1429,7 @@ supports_ssl_tls_version(sslv2 = Version) ->
Exe = "openssl",
Args = ["s_client", VersionFlag],
Port = ssl_test_lib:portable_open_port(Exe, Args),
- do_supports_ssl_tls_version(Port)
+ do_supports_ssl_tls_version(Port, "")
end;
supports_ssl_tls_version(Version) ->
@@ -1437,23 +1437,26 @@ supports_ssl_tls_version(Version) ->
Exe = "openssl",
Args = ["s_client", VersionFlag],
Port = ssl_test_lib:portable_open_port(Exe, Args),
- do_supports_ssl_tls_version(Port).
+ do_supports_ssl_tls_version(Port, "").
-do_supports_ssl_tls_version(Port) ->
+do_supports_ssl_tls_version(Port, Acc) ->
receive
- {Port, {data, "u"}} ->
- false;
- {Port, {data, "unknown option" ++ _}} ->
- false;
- {Port, {data, Data}} ->
- case lists:member("error", string:tokens(Data, ":")) of
- true ->
- false;
- false ->
- do_supports_ssl_tls_version(Port)
- end
+ {Port, {data, Data}} ->
+ case Acc ++ Data of
+ "unknown option" ++ _ ->
+ false;
+ Error when length(Error) >= 11 ->
+ case lists:member("error", string:tokens(Data, ":")) of
+ true ->
+ false;
+ false ->
+ do_supports_ssl_tls_version(Port, Error)
+ end;
+ _ ->
+ do_supports_ssl_tls_version(Port, Acc ++ Data)
+ end
after 1000 ->
- true
+ true
end.
ssl_options(Option, Config) when is_atom(Option) ->