dtls

Types


ciphers() = [ssl_cipher:erl_cipher_suite()] | string()

connect_option() = socket_connect_option()
                         | ssl_option()
                         | transport_option()

listen_option() = socket_listen_option()
                        | ssl_option()
                        | transport_option()

path() = string()

prf_random() = client_random | server_random

reason() = term()

socket_connect_option() = gen_tcp:connect_option()

socket_listen_option() = gen_tcp:listen_option()

ssl_imp() = new | old

ssl_option() = {versions, ssl_record:ssl_atom_version()}
                     | {verify, verify_type()}
                     | {verify_fun,
                        {function(), InitialUserState :: term()}}
                     | {fail_if_no_peer_cert, boolean()}
                     | {depth, integer()}
                     | {cert, Der :: binary()}
                     | {certfile, path()}
                     | {key, Der :: binary()}
                     | {keyfile, path()}
                     | {password, string()}
                     | {cacerts, [Der :: binary()]}
                     | {cacertfile, path()}
                     | {dh, Der :: binary()}
                     | {dhfile, path()}
                     | {user_lookup_fun,
                        {function(), InitialUserState :: term()}}
                     | {psk_identity, string()}
                     | {srp_identity, {string(), string()}}
                     | {ciphers, ciphers()}
                     | {ssl_imp, ssl_imp()}
                     | {reuse_sessions, boolean()}
                     | {reuse_session, function()}
                     | {hibernate_after, integer() | undefined}
                     | {next_protocols_advertised, [binary()]}
                     | {client_preferred_next_protocols,
                        binary(),
                        client | server,
                        [binary()]}

sslsocket() = #sslsocket{}

transport_option() =
            {cb_info,
             {CallbackModule :: atom(),
              DataTag :: atom(),
              ClosedTag :: atom(),
              ErrTag :: atom()}}

verify_type() = verify_none | verify_peer

Functions


connect(Socket::host() | port(), Options::[connect_option()]) -> {ok, #sslsocket{}} | {error, reason()}

connect(Socket::host() | port(), SslOptions::[connect_option()] | port_number() (see module inet), Timeout::timeout() | list()) -> {ok, #sslsocket{}} | {error, reason()}

listen(Port::port_number() (see module inet), Options::[listen_option()]) -> {ok, #sslsocket{}} | {error, reason()}

accept(Sslsocket::#sslsocket{}) -> {ok, #sslsocket{}} | {error, reason()}

accept(Sslsocket::#sslsocket{}, Timeout::timeout()) -> {ok, #sslsocket{}} | {error, reason()}

handshake(Sslsocket::#sslsocket{}) -> ok | {error, reason()}

handshake(Sslsocket::#sslsocket{} | port(), Timeout::timeout() | [ssl_option() | transport_option()]) -> ok | {ok, #sslsocket{}} | {error, reason()}

handshake(Socket::port(), SslOptions::[ssl_option() | transport_option()], Timeout::timeout()) -> {ok, #sslsocket{}} | {error, reason()}