aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-10-05 15:59:03 +0200
committerIngela Anderton Andin <[email protected]>2012-10-05 15:59:03 +0200
commit3761c5caafae68e2c275e5f0b1357172c6951147 (patch)
treefee9a67f59f0e5e4750fbe3e56ebfb8885af4bc0 /lib/ssl/test
parent5dc4302bcd680ac2fff8dacab22121b0f89f8d4a (diff)
parent07f4091e9e7bf16e0fab7ec18f79e7de8e5b5211 (diff)
downloadotp-3761c5caafae68e2c275e5f0b1357172c6951147.tar.gz
otp-3761c5caafae68e2c275e5f0b1357172c6951147.tar.bz2
otp-3761c5caafae68e2c275e5f0b1357172c6951147.zip
Merge branch 'ia/ssl/controlling-process-on-listen-socket/OTP-10447'
* ia/ssl/controlling-process-on-listen-socket/OTP-10447: ssl: Improve #sslsocket{} API ssl: It is now possible to call controlling_process on a listen socket, same as in gen_tcp.
Diffstat (limited to 'lib/ssl/test')
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl32
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index 6cf712fa6f..a202aca943 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -257,7 +257,8 @@ api_tests() ->
shutdown_write,
shutdown_both,
shutdown_error,
- hibernate
+ hibernate,
+ listen_socket
].
certificate_verify_tests() ->
@@ -3777,6 +3778,35 @@ hibernate(Config) ->
ssl_test_lib:close(Client).
%%--------------------------------------------------------------------
+listen_socket(doc) ->
+ ["Check error handling and inet compliance when calling API functions with listen sockets."];
+
+listen_socket(suite) ->
+ [];
+
+listen_socket(Config) ->
+ ServerOpts = ?config(server_opts, Config),
+ {ok, ListenSocket} = ssl:listen(0, ServerOpts),
+
+ %% This can be a valid thing to do as
+ %% options are inherited by the accept socket
+ ok = ssl:controlling_process(ListenSocket, self()),
+
+ {ok, _} = ssl:sockname(ListenSocket),
+
+ {error, enotconn} = ssl:send(ListenSocket, <<"data">>),
+ {error, enotconn} = ssl:recv(ListenSocket, 0),
+ {error, enotconn} = ssl:connection_info(ListenSocket),
+ {error, enotconn} = ssl:peername(ListenSocket),
+ {error, enotconn} = ssl:peercert(ListenSocket),
+ {error, enotconn} = ssl:session_info(ListenSocket),
+ {error, enotconn} = ssl:renegotiate(ListenSocket),
+ {error, enotconn} = ssl:prf(ListenSocket, 'master_secret', <<"Label">>, client_random, 256),
+ {error, enotconn} = ssl:shutdown(ListenSocket, read_write),
+
+ ok = ssl:close(ListenSocket).
+
+%%--------------------------------------------------------------------
connect_twice(doc) ->
[""];