ssl_connection

DATA TYPES

certdb_ref() = reference()
cipher() = null | rc4_128 | idea_cbc | des40_cbc | des_cbc | '3des_ede_cbc' | aes_128_cbc | aes_256_cbc
ciphers() = [erl_cipher_suite()] | string()
connect_option() = socket_connect_option() | ssl_option() | transport_option()
db_handle() = term()
erl_cipher_suite() = {key_algo(), cipher(), hash()}
gen_fsm_state_return() = {next_state, state_name(), term()} | {next_state, state_name(), term(), timeout()} | {stop, term(), term()}
hash() = null | sha | md5 | sha224 | sha256 | sha384 | sha512
host() = ip_address() (see module inet) | hostname() (see module inet)
key_algo() = null | rsa | dhe_rsa | dhe_dss | ecdhe_ecdsa | ecdh_ecdsa | ecdh_rsa | srp_rsa | srp_dss | psk | dhe_psk | rsa_psk | dh_anon | ecdh_anon | srp_anon
listen_option() = socket_listen_option() | ssl_option() | transport_option()
oid() = tuple()
path() = string()
prf_random() = client_random | server_random
public_key_info() = {oid(), #'RSAPublicKey'{} | integer() | #'ECPoint'{}, public_key_params()}
public_key_params() = #'Dss-Parms'{} | {namedCurve, oid()} | #'ECParameters'{} | term()
reason() = term()
socket_connect_option() = connect_option() (see module gen_tcp)
socket_listen_option() = listen_option() (see module gen_tcp)
ssl_imp() = new | old
ssl_option() = {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{}
state_name() = hello | abbreviated | certify | cipher | connection
tls_atom_version() = sslv3 | tlsv1 | 'tlsv1.1' | 'tlsv1.2'
tls_handshake_history() = {[binary()], [binary()]}
tls_version() = {integer(), integer()}
transport_option() = {cb_info, {CallbackModule::atom(), DataTag::atom(), ClosedTag::atom(), ErrTag::atom()}}
verify_type() = verify_none | verify_peer

Functions


connect(Connection::tls_connection | dtls_connection, Host::host(), Port::port_number() (see module inet), Socket::port(), Options::{#ssl_options{protocol=undefined | tls | dtls, versions=undefined | ['tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3] | ['dtlsv1.2' | dtlsv1], verify=undefined | verify_none | verify_peer, verify_fun=any(), fail_if_no_peer_cert=undefined | boolean(), verify_client_once=undefined | boolean(), validate_extensions_fun=any(), depth=undefined | integer(), certfile=undefined | binary(), cert=undefined | der_encoded(), keyfile=undefined | binary(), key=undefined | {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo', der_encoded()}, password=undefined | string(), cacerts=undefined | [der_encoded()], cacertfile=undefined | binary(), dh=undefined | der_encoded(), dhfile=undefined | binary(), user_lookup_fun=any(), psk_identity=undefined | binary(), srp_identity=any(), ciphers=any(), reuse_session=any(), reuse_sessions=undefined | boolean(), renegotiate_at=any(), secure_renegotiate=any(), debug=any(), hibernate_after=undefined | boolean(), erl_dist=boolean(), next_protocols_advertised=any(), next_protocol_selector=any(), log_alert=undefined | boolean(), server_name_indication=any()}, #socket_options{}}, User::pid(), CbInfo::tuple(), Timeout::timeout()) -> {ok, #sslsocket{}} | {error, reason()}

ssl_accept(Connection::tls_connection | dtls_connection, Port::port_number() (see module inet), Socket::port(), Opts::{#ssl_options{protocol=undefined | tls | dtls, versions=undefined | ['tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3] | ['dtlsv1.2' | dtlsv1], verify=undefined | verify_none | verify_peer, verify_fun=any(), fail_if_no_peer_cert=undefined | boolean(), verify_client_once=undefined | boolean(), validate_extensions_fun=any(), depth=undefined | integer(), certfile=undefined | binary(), cert=undefined | der_encoded(), keyfile=undefined | binary(), key=undefined | {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo', der_encoded()}, password=undefined | string(), cacerts=undefined | [der_encoded()], cacertfile=undefined | binary(), dh=undefined | der_encoded(), dhfile=undefined | binary(), user_lookup_fun=any(), psk_identity=undefined | binary(), srp_identity=any(), ciphers=any(), reuse_session=any(), reuse_sessions=undefined | boolean(), renegotiate_at=any(), secure_renegotiate=any(), debug=any(), hibernate_after=undefined | boolean(), erl_dist=boolean(), next_protocols_advertised=any(), next_protocol_selector=any(), log_alert=undefined | boolean(), server_name_indication=any()}, #socket_options{}}, User::pid(), CbInfo::tuple(), Timeout::timeout()) -> {ok, #sslsocket{}} | {error, reason()}

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

socket_control(Connection::tls_connection | dtls_connection, Socket::port(), Pid::pid(), Transport::atom()) -> {ok, #sslsocket{}} | {error, reason()}

send(Pid::pid(), Data::iodata()) -> ok | {error, reason()}

recv(Pid::pid(), Length::integer(), Timeout::timeout()) -> {ok, binary() | list()} | {error, reason()}

close(ConnectionPid::pid()) -> ok | {error, reason()}

shutdown(ConnectionPid::pid(), How::atom()) -> ok | {error, reason()}

new_user(ConnectionPid::pid(), User::pid()) -> ok | {error, reason()}

negotiated_next_protocol(ConnectionPid::pid()) -> {ok, binary()} | {error, reason()}

get_opts(ConnectionPid::pid(), OptTags::list()) -> {ok, list()} | {error, reason()}

set_opts(ConnectionPid::pid(), Options::list()) -> ok | {error, reason()}

info(ConnectionPid::pid()) -> {ok, {atom(), tuple()}} | {error, reason()}

session_info(ConnectionPid::pid()) -> {ok, list()} | {error, reason()}

peer_certificate(ConnectionPid::pid()) -> {ok, binary() | undefined} | {error, reason()}

renegotiation(ConnectionPid::pid()) -> ok | {error, reason()}

prf(ConnectionPid::pid(), Secret::binary() | master_secret, Label::binary(), Seed::binary() | prf_random() (see module ssl), WantedLength::non_neg_integer()) -> {ok, binary()} | {error, reason()} | {'EXIT', term()}

handle_session(Server_hello, Version, NewId, ConnectionStates, NextProtocol, State) -> term()

hello(Hello_request::start | #hello_request{} | #server_hello{} | term(), State::#state{role=undefined | client | server, user_application=undefined | {Monitor::reference(), User::pid()}, transport_cb=undefined | atom(), protocol_cb=undefined | tls_connection | dtls_connection, data_tag=undefined | atom(), close_tag=undefined | atom(), error_tag=undefined | atom(), host=undefined | string() | ipaddress() (see module inet), port=undefined | integer(), socket=undefined | port(), ssl_options=undefined | #ssl_options{protocol=undefined | tls | dtls, versions=undefined | ['tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3] | ['dtlsv1.2' | dtlsv1], verify=undefined | verify_none | verify_peer, verify_fun=any(), fail_if_no_peer_cert=undefined | boolean(), verify_client_once=undefined | boolean(), validate_extensions_fun=any(), depth=undefined | integer(), certfile=undefined | binary(), cert=undefined | der_encoded(), keyfile=undefined | binary(), key=undefined | {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo', der_encoded()}, password=undefined | string(), cacerts=undefined | [der_encoded()], cacertfile=undefined | binary(), dh=undefined | der_encoded(), dhfile=undefined | binary(), user_lookup_fun=any(), psk_identity=undefined | binary(), srp_identity=any(), ciphers=any(), reuse_session=any(), reuse_sessions=undefined | boolean(), renegotiate_at=any(), secure_renegotiate=any(), debug=any(), hibernate_after=undefined | boolean(), erl_dist=boolean(), next_protocols_advertised=any(), next_protocol_selector=any(), log_alert=undefined | boolean(), server_name_indication=any()}, socket_options=undefined | #socket_options{}, connection_states=undefined | #connection_states{}, protocol_buffers=undefined | term(), tls_handshake_history=undefined | tls_handshake_history(), cert_db=undefined | reference(), session=undefined | #session{}, session_cache=undefined | db_handle(), session_cache_cb=undefined | atom(), negotiated_version=undefined | tls_version(), client_certificate_requested=boolean(), key_algorithm=undefined | key_algo(), hashsign_algorithm=any(), cert_hashsign_algorithm=any(), public_key_info=undefined | public_key_info(), private_key=undefined | private_key() (see module public_key), diffie_hellman_params=any(), diffie_hellman_keys=any(), psk_identity=undefined | binary(), srp_params=undefined | #srp_user{generator=undefined | binary(), prime=undefined | binary(), salt=undefined | binary(), verifier=undefined | binary()}, srp_keys=undefined | {PublicKey::binary(), PrivateKey::binary()}, premaster_secret=undefined | binary(), file_ref_db=undefined | db_handle(), cert_db_ref=undefined | certdb_ref(), bytes_to_read=undefined | integer(), user_data_buffer=undefined | binary(), renegotiation=undefined | {boolean(), From::term() | internal | peer}, start_or_recv_from=undefined | term(), timer=undefined | reference(), send_queue=undefined | queue(), terminated=boolean(), allow_renegotiate=boolean(), expecting_next_protocol_negotiation=boolean(), next_protocol=undefined | binary(), client_ecc=any()}, Connection::tls_connection | dtls_connection) -> gen_fsm_state_return()

abbreviated(Hello_request::#hello_request{} | #finished{} | term(), State::#state{role=undefined | client | server, user_application=undefined | {Monitor::reference(), User::pid()}, transport_cb=undefined | atom(), protocol_cb=undefined | tls_connection | dtls_connection, data_tag=undefined | atom(), close_tag=undefined | atom(), error_tag=undefined | atom(), host=undefined | string() | ipaddress() (see module inet), port=undefined | integer(), socket=undefined | port(), ssl_options=undefined | #ssl_options{protocol=undefined | tls | dtls, versions=undefined | ['tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3] | ['dtlsv1.2' | dtlsv1], verify=undefined | verify_none | verify_peer, verify_fun=any(), fail_if_no_peer_cert=undefined | boolean(), verify_client_once=undefined | boolean(), validate_extensions_fun=any(), depth=undefined | integer(), certfile=undefined | binary(), cert=undefined | der_encoded(), keyfile=undefined | binary(), key=undefined | {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo', der_encoded()}, password=undefined | string(), cacerts=undefined | [der_encoded()], cacertfile=undefined | binary(), dh=undefined | der_encoded(), dhfile=undefined | binary(), user_lookup_fun=any(), psk_identity=undefined | binary(), srp_identity=any(), ciphers=any(), reuse_session=any(), reuse_sessions=undefined | boolean(), renegotiate_at=any(), secure_renegotiate=any(), debug=any(), hibernate_after=undefined | boolean(), erl_dist=boolean(), next_protocols_advertised=any(), next_protocol_selector=any(), log_alert=undefined | boolean(), server_name_indication=any()}, socket_options=undefined | #socket_options{}, connection_states=undefined | #connection_states{}, protocol_buffers=undefined | term(), tls_handshake_history=undefined | tls_handshake_history(), cert_db=undefined | reference(), session=undefined | #session{}, session_cache=undefined | db_handle(), session_cache_cb=undefined | atom(), negotiated_version=undefined | tls_version(), client_certificate_requested=boolean(), key_algorithm=undefined | key_algo(), hashsign_algorithm=any(), cert_hashsign_algorithm=any(), public_key_info=undefined | public_key_info(), private_key=undefined | private_key() (see module public_key), diffie_hellman_params=any(), diffie_hellman_keys=any(), psk_identity=undefined | binary(), srp_params=undefined | #srp_user{generator=undefined | binary(), prime=undefined | binary(), salt=undefined | binary(), verifier=undefined | binary()}, srp_keys=undefined | {PublicKey::binary(), PrivateKey::binary()}, premaster_secret=undefined | binary(), file_ref_db=undefined | db_handle(), cert_db_ref=undefined | certdb_ref(), bytes_to_read=undefined | integer(), user_data_buffer=undefined | binary(), renegotiation=undefined | {boolean(), From::term() | internal | peer}, start_or_recv_from=undefined | term(), timer=undefined | reference(), send_queue=undefined | queue(), terminated=boolean(), allow_renegotiate=boolean(), expecting_next_protocol_negotiation=boolean(), next_protocol=undefined | binary(), client_ecc=any()}, Connection::tls_connection | dtls_connection) -> gen_fsm_state_return()

certify(Hello_request::#hello_request{} | #certificate{} | #server_key_exchange{} | #certificate_request{} | #server_hello_done{} | #client_key_exchange{} | term(), State::#state{role=undefined | client | server, user_application=undefined | {Monitor::reference(), User::pid()}, transport_cb=undefined | atom(), protocol_cb=undefined | tls_connection | dtls_connection, data_tag=undefined | atom(), close_tag=undefined | atom(), error_tag=undefined | atom(), host=undefined | string() | ipaddress() (see module inet), port=undefined | integer(), socket=undefined | port(), ssl_options=undefined | #ssl_options{protocol=undefined | tls | dtls, versions=undefined | ['tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3] | ['dtlsv1.2' | dtlsv1], verify=undefined | verify_none | verify_peer, verify_fun=any(), fail_if_no_peer_cert=undefined | boolean(), verify_client_once=undefined | boolean(), validate_extensions_fun=any(), depth=undefined | integer(), certfile=undefined | binary(), cert=undefined | der_encoded(), keyfile=undefined | binary(), key=undefined | {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo', der_encoded()}, password=undefined | string(), cacerts=undefined | [der_encoded()], cacertfile=undefined | binary(), dh=undefined | der_encoded(), dhfile=undefined | binary(), user_lookup_fun=any(), psk_identity=undefined | binary(), srp_identity=any(), ciphers=any(), reuse_session=any(), reuse_sessions=undefined | boolean(), renegotiate_at=any(), secure_renegotiate=any(), debug=any(), hibernate_after=undefined | boolean(), erl_dist=boolean(), next_protocols_advertised=any(), next_protocol_selector=any(), log_alert=undefined | boolean(), server_name_indication=any()}, socket_options=undefined | #socket_options{}, connection_states=undefined | #connection_states{}, protocol_buffers=undefined | term(), tls_handshake_history=undefined | tls_handshake_history(), cert_db=undefined | reference(), session=undefined | #session{}, session_cache=undefined | db_handle(), session_cache_cb=undefined | atom(), negotiated_version=undefined | tls_version(), client_certificate_requested=boolean(), key_algorithm=undefined | key_algo(), hashsign_algorithm=any(), cert_hashsign_algorithm=any(), public_key_info=undefined | public_key_info(), private_key=undefined | private_key() (see module public_key), diffie_hellman_params=any(), diffie_hellman_keys=any(), psk_identity=undefined | binary(), srp_params=undefined | #srp_user{generator=undefined | binary(), prime=undefined | binary(), salt=undefined | binary(), verifier=undefined | binary()}, srp_keys=undefined | {PublicKey::binary(), PrivateKey::binary()}, premaster_secret=undefined | binary(), file_ref_db=undefined | db_handle(), cert_db_ref=undefined | certdb_ref(), bytes_to_read=undefined | integer(), user_data_buffer=undefined | binary(), renegotiation=undefined | {boolean(), From::term() | internal | peer}, start_or_recv_from=undefined | term(), timer=undefined | reference(), send_queue=undefined | queue(), terminated=boolean(), allow_renegotiate=boolean(), expecting_next_protocol_negotiation=boolean(), next_protocol=undefined | binary(), client_ecc=any()}, Connection::tls_connection | dtls_connection) -> gen_fsm_state_return()

cipher(Hello_request::#hello_request{} | #certificate_verify{} | #finished{} | term(), State::#state{role=undefined | client | server, user_application=undefined | {Monitor::reference(), User::pid()}, transport_cb=undefined | atom(), protocol_cb=undefined | tls_connection | dtls_connection, data_tag=undefined | atom(), close_tag=undefined | atom(), error_tag=undefined | atom(), host=undefined | string() | ipaddress() (see module inet), port=undefined | integer(), socket=undefined | port(), ssl_options=undefined | #ssl_options{protocol=undefined | tls | dtls, versions=undefined | ['tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3] | ['dtlsv1.2' | dtlsv1], verify=undefined | verify_none | verify_peer, verify_fun=any(), fail_if_no_peer_cert=undefined | boolean(), verify_client_once=undefined | boolean(), validate_extensions_fun=any(), depth=undefined | integer(), certfile=undefined | binary(), cert=undefined | der_encoded(), keyfile=undefined | binary(), key=undefined | {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo', der_encoded()}, password=undefined | string(), cacerts=undefined | [der_encoded()], cacertfile=undefined | binary(), dh=undefined | der_encoded(), dhfile=undefined | binary(), user_lookup_fun=any(), psk_identity=undefined | binary(), srp_identity=any(), ciphers=any(), reuse_session=any(), reuse_sessions=undefined | boolean(), renegotiate_at=any(), secure_renegotiate=any(), debug=any(), hibernate_after=undefined | boolean(), erl_dist=boolean(), next_protocols_advertised=any(), next_protocol_selector=any(), log_alert=undefined | boolean(), server_name_indication=any()}, socket_options=undefined | #socket_options{}, connection_states=undefined | #connection_states{}, protocol_buffers=undefined | term(), tls_handshake_history=undefined | tls_handshake_history(), cert_db=undefined | reference(), session=undefined | #session{}, session_cache=undefined | db_handle(), session_cache_cb=undefined | atom(), negotiated_version=undefined | tls_version(), client_certificate_requested=boolean(), key_algorithm=undefined | key_algo(), hashsign_algorithm=any(), cert_hashsign_algorithm=any(), public_key_info=undefined | public_key_info(), private_key=undefined | private_key() (see module public_key), diffie_hellman_params=any(), diffie_hellman_keys=any(), psk_identity=undefined | binary(), srp_params=undefined | #srp_user{generator=undefined | binary(), prime=undefined | binary(), salt=undefined | binary(), verifier=undefined | binary()}, srp_keys=undefined | {PublicKey::binary(), PrivateKey::binary()}, premaster_secret=undefined | binary(), file_ref_db=undefined | db_handle(), cert_db_ref=undefined | certdb_ref(), bytes_to_read=undefined | integer(), user_data_buffer=undefined | binary(), renegotiation=undefined | {boolean(), From::term() | internal | peer}, start_or_recv_from=undefined | term(), timer=undefined | reference(), send_queue=undefined | queue(), terminated=boolean(), allow_renegotiate=boolean(), expecting_next_protocol_negotiation=boolean(), next_protocol=undefined | binary(), client_ecc=any()}, Connection::tls_connection | dtls_connection) -> gen_fsm_state_return()

connection(Msg::term(), State::#state{role=undefined | client | server, user_application=undefined | {Monitor::reference(), User::pid()}, transport_cb=undefined | atom(), protocol_cb=undefined | tls_connection | dtls_connection, data_tag=undefined | atom(), close_tag=undefined | atom(), error_tag=undefined | atom(), host=undefined | string() | ipaddress() (see module inet), port=undefined | integer(), socket=undefined | port(), ssl_options=undefined | #ssl_options{protocol=undefined | tls | dtls, versions=undefined | ['tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3] | ['dtlsv1.2' | dtlsv1], verify=undefined | verify_none | verify_peer, verify_fun=any(), fail_if_no_peer_cert=undefined | boolean(), verify_client_once=undefined | boolean(), validate_extensions_fun=any(), depth=undefined | integer(), certfile=undefined | binary(), cert=undefined | der_encoded(), keyfile=undefined | binary(), key=undefined | {'RSAPrivateKey' | 'DSAPrivateKey' | 'ECPrivateKey' | 'PrivateKeyInfo', der_encoded()}, password=undefined | string(), cacerts=undefined | [der_encoded()], cacertfile=undefined | binary(), dh=undefined | der_encoded(), dhfile=undefined | binary(), user_lookup_fun=any(), psk_identity=undefined | binary(), srp_identity=any(), ciphers=any(), reuse_session=any(), reuse_sessions=undefined | boolean(), renegotiate_at=any(), secure_renegotiate=any(), debug=any(), hibernate_after=undefined | boolean(), erl_dist=boolean(), next_protocols_advertised=any(), next_protocol_selector=any(), log_alert=undefined | boolean(), server_name_indication=any()}, socket_options=undefined | #socket_options{}, connection_states=undefined | #connection_states{}, protocol_buffers=undefined | term(), tls_handshake_history=undefined | tls_handshake_history(), cert_db=undefined | reference(), session=undefined | #session{}, session_cache=undefined | db_handle(), session_cache_cb=undefined | atom(), negotiated_version=undefined | tls_version(), client_certificate_requested=boolean(), key_algorithm=undefined | key_algo(), hashsign_algorithm=any(), cert_hashsign_algorithm=any(), public_key_info=undefined | public_key_info(), private_key=undefined | private_key() (see module public_key), diffie_hellman_params=any(), diffie_hellman_keys=any(), psk_identity=undefined | binary(), srp_params=undefined | #srp_user{generator=undefined | binary(), prime=undefined | binary(), salt=undefined | binary(), verifier=undefined | binary()}, srp_keys=undefined | {PublicKey::binary(), PrivateKey::binary()}, premaster_secret=undefined | binary(), file_ref_db=undefined | db_handle(), cert_db_ref=undefined | certdb_ref(), bytes_to_read=undefined | integer(), user_data_buffer=undefined | binary(), renegotiation=undefined | {boolean(), From::term() | internal | peer}, start_or_recv_from=undefined | term(), timer=undefined | reference(), send_queue=undefined | queue(), terminated=boolean(), allow_renegotiate=boolean(), expecting_next_protocol_negotiation=boolean(), next_protocol=undefined | binary(), client_ecc=any()}, Connection::tls_connection | dtls_connection) -> gen_fsm_state_return()

handle_sync_event(X1, From, StateName, State) -> term()

handle_info(Msg, StateName, State) -> term()

terminate(Reason, StateName, State) -> term()