mirror of
https://github.com/valitydev/woody_erlang.git
synced 2024-11-06 02:15:19 +00:00
MSPF-458: Fix ssl SUITE tests (#106)
* MSPF-458: Fix ssl SUITE tests * MSPF-458: Remove extra newline
This commit is contained in:
parent
a4921bde49
commit
f0df3414cf
@ -90,11 +90,13 @@ end_per_suite(C) ->
|
|||||||
|
|
||||||
client_wo_cert_test(C) ->
|
client_wo_cert_test(C) ->
|
||||||
SSLOptions = [{cacertfile, ?ca_cert(C)}],
|
SSLOptions = [{cacertfile, ?ca_cert(C)}],
|
||||||
?assertException(
|
try
|
||||||
error,
|
get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions),
|
||||||
{woody_error, {internal, result_unexpected, <<"{tls_alert,\"handshake failure\"}">>}},
|
error(unreachable)
|
||||||
get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions)
|
catch
|
||||||
).
|
error:{woody_error, {internal, result_unexpected, Reason}} ->
|
||||||
|
{match, _} = re:run(Reason, <<"^{tls_alert,[\"\{]handshake[ _]failure.*$">>, [])
|
||||||
|
end.
|
||||||
|
|
||||||
-spec valid_client_cert_test(config()) -> _.
|
-spec valid_client_cert_test(config()) -> _.
|
||||||
|
|
||||||
@ -106,11 +108,13 @@ valid_client_cert_test(C) ->
|
|||||||
|
|
||||||
invalid_client_cert_test(C) ->
|
invalid_client_cert_test(C) ->
|
||||||
SSLOptions = [{cacertfile, ?ca_cert(C)}, {certfile, ?invalid_client_cert(C)}],
|
SSLOptions = [{cacertfile, ?ca_cert(C)}, {certfile, ?invalid_client_cert(C)}],
|
||||||
?assertException(
|
try
|
||||||
error,
|
get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions),
|
||||||
{woody_error, {internal, result_unexpected, <<"{tls_alert,\"unknown ca\"}">>}},
|
error(unreachable)
|
||||||
get_weapon(?FUNCTION_NAME, <<"BFG">>, SSLOptions)
|
catch
|
||||||
).
|
error:{woody_error, {internal, result_unexpected, Reason}} ->
|
||||||
|
{match, _} = re:run(Reason, <<"^{tls_alert,[\"\{]unknown[ _]ca.*$">>, [])
|
||||||
|
end.
|
||||||
|
|
||||||
%%%
|
%%%
|
||||||
%%% woody_event_handler callback
|
%%% woody_event_handler callback
|
||||||
|
Loading…
Reference in New Issue
Block a user