Skip to content

Commit

Permalink
fixup! Store test config certs in funs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgud committed Nov 18, 2024
1 parent e2ae5b5 commit ad2ada1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions lib/ssl/test/openssl_mfl_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ openssl_client(Config) when is_list(Config) ->
%--------------------------------------------------------------------------------
reuse_session_erlang_server(Config) when is_list(Config) ->
ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
ClientOpts = proplists:get_value(client_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
Protocol = proplists:get_value(protocol, ServerOpts, tls),
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
MFL = 512,
Expand All @@ -136,7 +136,7 @@ reuse_session_erlang_server(Config) when is_list(Config) ->
reuse_session_erlang_client(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ClientOpts0 = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = proplists:get_value(server_rsa_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
{ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
Protocol = proplists:get_value(protocol, ClientOpts0, tls),
MFL = 512,
Expand Down Expand Up @@ -180,7 +180,7 @@ reuse_session_erlang_client(Config) when is_list(Config) ->

openssl_client(MFL, Config) ->
ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
ClientOpts = proplists:get_value(client_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
Protocol = proplists:get_value(protocol, ServerOpts, tls),
{_, ServerNode, _} = ssl_test_lib:run_where(Config),

Expand All @@ -205,7 +205,7 @@ openssl_client(MFL, Config) ->

openssl_server(MFL, Config) ->
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = proplists:get_value(server_rsa_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
Protocol = proplists:get_value(protocol, ClientOpts, tls),
{ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),

Expand Down
30 changes: 15 additions & 15 deletions lib/ssl/test/openssl_npn_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ erlang_client_openssl_server_npn() ->
[{doc,"Test erlang client with openssl server doing npn negotiation"}].

erlang_client_openssl_server_npn(Config) when is_list(Config) ->
ServerOpts = proplists:get_value(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
NpnProtocol = <<"spdy/2">>,

{Server, OpenSSLPort} =
Expand Down Expand Up @@ -161,8 +161,8 @@ erlang_client_openssl_server_npn_renegotiate() ->

erlang_client_openssl_server_npn_renegotiate(Config) when is_list(Config) ->

ServerOpts = proplists:get_value(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
NpnProtocol = <<"spdy/2">>,

Server = ssl_test_lib:start_server(openssl, [{np,"http/1.1,spdy/2"}],
Expand Down Expand Up @@ -197,8 +197,8 @@ erlang_server_openssl_client_npn() ->
[{doc,"Test erlang server with openssl client and npn negotiation"}].

erlang_server_openssl_client_npn(Config) when is_list(Config) ->
ClientOpts = proplists:get_value(client_rsa_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
Protocol = <<"spdy/2">>,
Server = ssl_test_lib:start_server(erlang, [{from, self()}],
[{server_opts, [{next_protocols_advertised,
Expand Down Expand Up @@ -230,8 +230,8 @@ erlang_server_openssl_client_npn(Config) when is_list(Config) ->
%% [{doc,"Test erlang server with openssl client and npn negotiation with renegotiation"}].

erlang_server_openssl_client_npn_renegotiate(Config) when is_list(Config) ->
ClientOpts = proplists:get_value(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
NpnProtocol = <<"spdy/2">>,
Server =
ssl_test_lib:start_server(erlang, [{from, self()}],
Expand Down Expand Up @@ -266,8 +266,8 @@ erlang_server_openssl_client_npn_renegotiate(Config) when is_list(Config) ->
ssl:close(SSocket).
%%--------------------------------------------------------------------------
erlang_client_openssl_server_npn_only_client(Config) when is_list(Config) ->
ServerOpts = proplists:get_value(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),

{Server, OpenSSLPort} =
ssl_test_lib:start_server(openssl, [{np,"spdy/2"}, return_port],
Expand All @@ -290,8 +290,8 @@ erlang_client_openssl_server_npn_only_client(Config) when is_list(Config) ->

%%--------------------------------------------------------------------------
erlang_client_openssl_server_npn_only_server(Config) when is_list(Config) ->
ServerOpts = proplists:get_value(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),

{Server, OpenSSLPort} =
ssl_test_lib:start_server(openssl, [{np,"spdy/2"}, return_port],
Expand All @@ -314,7 +314,7 @@ erlang_client_openssl_server_npn_only_server(Config) when is_list(Config) ->

%%--------------------------------------------------------------------------
erlang_server_openssl_client_npn_only_server(Config) when is_list(Config) ->
ClientOpts = proplists:get_value(client_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
Server =
ssl_test_lib:start_server(erlang, [{from, self()}],
Expand Down Expand Up @@ -344,8 +344,8 @@ erlang_server_openssl_client_npn_only_server(Config) when is_list(Config) ->

%%--------------------------------------------------------------------------
erlang_server_openssl_client_npn_only_client(Config) when is_list(Config) ->
ClientOpts = proplists:get_value(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
ClientOpts = ssl_test_lib:ssl_options(client_rsa_verify_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
Server = ssl_test_lib:start_server(erlang, [{from, self()}],
[{server_opts, [ServerOpts]} | Config]),
Port = ssl_test_lib:inet_port(Server),
Expand Down

0 comments on commit ad2ada1

Please sign in to comment.