From 396ec26494008e18b573707986e32733e468346d Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Wed, 26 Mar 2014 15:50:40 +0100
Subject: ssl: Add possibility to specify ssl options when calling
ssl:ssl_accept
---
lib/ssl/doc/src/ssl.xml | 69 ++++++++++++++++++++++++++++---------------------
1 file changed, 40 insertions(+), 29 deletions(-)
(limited to 'lib/ssl/doc/src')
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 4bc1a9a644..ffee4bd1af 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -768,39 +768,45 @@ fun(srp, Username :: string(), UserState :: term()) ->
- ssl_accept(ListenSocket) ->
- ssl_accept(ListenSocket, Timeout) -> ok | {error, Reason}
- Perform server-side SSL handshake
+ ssl_accept(Socket) ->
+ ssl_accept(Socket, Timeout) -> ok | {error, Reason}
+ Perform server-side SSL/TLS handshake
- ListenSocket = sslsocket()
+ Socket = sslsocket()
Timeout = integer()
Reason = term()
- The ssl_accept function establish the SSL connection
- on the server side. It should be called directly after
- transport_accept, in the spawned server-loop.
+ Performs the SSL/TLS server-side handshake Socket is a socket as returned
+ by ssl:transport_accept/[1,2]
+
- ssl_accept(ListenSocket, SslOptions) ->
- ssl_accept(ListenSocket, SslOptions, Timeout) -> {ok, Socket} | {error, Reason}
- Perform server-side SSL handshake
+ ssl_accept(Socket, SslOptions) ->
+ ssl_accept(Socket, SslOptions, Timeout) -> {ok, Socket} | ok | {error, Reason}
+ Perform server-side SSL/TLS handshake
- ListenSocket = socket()
+ Socket = socket() | sslsocket()
SslOptions = ssloptions()
Timeout = integer()
Reason = term()
- Upgrades a gen_tcp, or
- equivalent, socket to an ssl socket i.e. performs the
- ssl server-side handshake.
+ If Socket is a socket() - upgrades a gen_tcp, or equivalent, socket to an ssl socket
+ i.e. performs the SSL/TLS server-side handshake and returns the ssl socket.
+
+
Note that the listen socket should be in {active, false} mode
before telling the client that the server is ready to upgrade
- and calling this function, otherwise the upgrade may
+ by calling this function, otherwise the upgrade may
or may not succeed depending on timing.
+
+ If Socket is an sslsocket() - provides additional SSL/TLS options to those specified in ssl:listen/2 and then performs the SSL/TLS handshake.
+
@@ -842,33 +848,38 @@ fun(srp, Username :: string(), UserState :: term()) ->
- transport_accept(Socket) ->
- transport_accept(Socket, Timeout) ->
+ transport_accept(ListenSocket) ->
+ transport_accept(ListenSocket, Timeout) ->
{ok, NewSocket} | {error, Reason}
Accept an incoming connection and
prepare for ssl_accept
- Socket = NewSocket = sslsocket()
+ ListenSocket = NewSocket = sslsocket()
Timeout = integer()
Reason = reason()
Accepts an incoming connection request on a listen socket.
- ListenSocket must be a socket returned from
- listen/2. The socket returned should be passed to
- ssl_accept to complete ssl handshaking and
- establishing the connection.
+ ListenSocket must be a socket returned from
+ ssl:listen/2.
+ The socket returned should be passed to
+ ssl:ssl_accept[2,3]
+ to complete handshaking i.e
+ establishing the SSL/TLS connection.
- The socket returned can only be used with ssl_accept,
- no traffic can be sent or received before that call.
+ The socket returned can only be used with
+ ssl:ssl_accept[2,3]
+ no traffic can be sent or received before that call.
The accepted socket inherits the options set for
- ListenSocket in listen/2.
+ ListenSocket in ssl:listen/2.
The default
- value for Timeout is infinity. If
- Timeout is specified, and no connection is accepted
- within the given time, {error, timeout} is
- returned.
+ value for Timeout is infinity. If
+ Timeout is specified, and no connection is accepted
+ within the given time, {error, timeout} is
+ returned.
--
cgit v1.2.3