aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-05-31 10:56:10 +0200
committerIngela Anderton Andin <[email protected]>2016-05-31 10:56:10 +0200
commit962b25f3b2879a48a8cd0596ffad862beb82d4d9 (patch)
treed6c1b9bcb667e7f0134d0002c3406190ce3b8584 /lib/ssl/test
parent1a212675c4217bbedfab1e181a88b2fbe4cfa9c4 (diff)
parentd56242c69f84d7612aebd045255c41d85cbb1794 (diff)
downloadotp-962b25f3b2879a48a8cd0596ffad862beb82d4d9.tar.gz
otp-962b25f3b2879a48a8cd0596ffad862beb82d4d9.tar.bz2
otp-962b25f3b2879a48a8cd0596ffad862beb82d4d9.zip
Merge branch 'binarin/better-ssl-diagnostics/PR-1060/ERL-774/OTP-13632'
* binarin/better-ssl-diagnostics/PR-1060/ERL-774/OTP-13632: ssl: Remove error logger reports ssl: Better error handling of keys rejected by crypto Improve SSL diagnostics
Diffstat (limited to 'lib/ssl/test')
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index aa45d55406..686cdc569d 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -96,6 +96,8 @@ basic_tests() ->
[app,
appup,
alerts,
+ alert_details,
+ alert_details_not_too_big,
version_option,
connect_twice,
connect_dist,
@@ -477,6 +479,33 @@ alerts(Config) when is_list(Config) ->
end
end, Alerts).
%%--------------------------------------------------------------------
+alert_details() ->
+ [{doc, "Test that ssl_alert:alert_txt/1 result contains extendend error description"}].
+alert_details(Config) when is_list(Config) ->
+ Unique = make_ref(),
+ UniqueStr = lists:flatten(io_lib:format("~w", [Unique])),
+ Alert = ?ALERT_REC(?WARNING, ?CLOSE_NOTIFY, Unique),
+ case string:str(ssl_alert:alert_txt(Alert), UniqueStr) of
+ 0 ->
+ ct:fail(error_details_missing);
+ _ ->
+ ok
+ end.
+
+%%--------------------------------------------------------------------
+alert_details_not_too_big() ->
+ [{doc, "Test that ssl_alert:alert_txt/1 limits printed depth of extended error description"}].
+alert_details_not_too_big(Config) when is_list(Config) ->
+ Reason = lists:duplicate(10, lists:duplicate(10, lists:duplicate(10, {some, data}))),
+ Alert = ?ALERT_REC(?WARNING, ?CLOSE_NOTIFY, Reason),
+ case length(ssl_alert:alert_txt(Alert)) < 1000 of
+ true ->
+ ok;
+ false ->
+ ct:fail(ssl_alert_text_too_big)
+ end.
+
+%%--------------------------------------------------------------------
new_options_in_accept() ->
[{doc,"Test that you can set ssl options in ssl_accept/3 and not only in tcp upgrade"}].
new_options_in_accept(Config) when is_list(Config) ->