Behaviours: gen_server.
Authors: Jean-Sébastien Pédron (js.pedron@meetic-corp.com).
abstract datatype: tls_socket()
TLS socket obtained with connect/4
or accept/4
.
accept/4 | Start TLS handshake as a server. |
close/1 | Shutdown the TLS session and close the underlying socket. |
connect/4 | Start TLS handshake as a client. |
controlling_process/2 | Change the controlling socket of the underlying socket. |
get_auth_methods/0 | Return the list of supported auth methods. |
get_engine_driver/1 | Return the port driver name associated to the given engine. |
get_engine_names/0 | Return the list of TLS engines. |
get_engine_names/1 | Return the list of TLS engines which support the given auth method. |
get_finished/1 | Retrieve latest "Finished" message (sent out from this side). |
get_peer_certificate/1 | Return the peer certificate if he provided one. |
get_peer_finished/1 | Retrieve latest "Finished" message (received on this side). |
get_prefered_engine_name/1 | Return the name of the prefered TLS engines which support the given auth method. |
get_verify_result/1 | Return verify result. |
getopts/2 | Gets one or more options for a socket. |
handshake/5 | |
is_engine_available/1 | Tell if Engine_Name is available. |
peername/1 | Returns the address and port for the other end of a connection. |
quiet_shutdown/1 | Flag the TLS session as down but do not exchange "close notify". |
recv/1 | Receive data over a TLS-protected connection. |
recv/2 | Receive data over a TLS-protected connection. |
recv_data/2 | Decrypt already received data. |
register_engine/3 | Add a new TLS engine. |
register_engine/4 | Add a new TLS engine. |
send/2 | Send Orig_Packet over a TLS-protected connection. |
send_data/2 | |
setopts/2 | Sets one or more options for a socket. |
shutdown/1 | Shutdown the TLS session. |
shutdown/2 | Shutdown the TLS session. |
shutdown/3 | Shutdown the TLS session. |
sockname/1 | Returns the local address and port number for a socket. |
accept(Socket_Desc, Identity, Peer_Verification, Options) -> TLS_Socket
Start TLS handshake as a server.
close(Tls_socket::TLS_Socket) -> ok | {error, Reason}
Shutdown the TLS session and close the underlying socket.
connect(Socket_Desc, Identity, Peer_Verification, Options) -> TLS_Socket
Start TLS handshake as a client.
controlling_process(Tls_socket::TLS_Socket, Pid) -> ok | {error, Reason}
Change the controlling socket of the underlying socket.
get_auth_methods() -> [Auth_Method]
Return the list of supported auth methods.
get_engine_driver(Engine_Name) -> Driver_Name
Return the port driver name associated to the given engine.
get_engine_names() -> [Engine_Name]
Return the list of TLS engines.
get_engine_names(Auth_Method) -> [Engine_Name]
Return the list of TLS engines which support the given auth method.
The list is sorted from the most to the least prefered engine.get_finished(Tls_socket::TLS_Socket) -> Finished
Retrieve latest "Finished" message (sent out from this side).
"Finished" message is needed for tls-unique channel binding, used for example by SCRAM-SHA-1-PLUS SASL method.get_peer_certificate(Tls_socket::TLS_Socket) -> Certificate | undefined
throws {tls, peer_certificate, decode_failed, Reason}
Return the peer certificate if he provided one.
Note that a client will only send a certificate when requested by a server. This means that in the server case, this function will return anything only when peer verification is enabled.
Certificate is returned as a public_key certificate record.get_peer_finished(Tls_socket::TLS_Socket) -> Finished
Retrieve latest "Finished" message (received on this side).
"Finished" message is needed for tls-unique channel binding, used for example by SCRAM-SHA-1-PLUS SASL method.get_prefered_engine_name(Auth_Method) -> [Engine_Name]
Return the name of the prefered TLS engines which support the given auth method.
get_verify_result(Tls_socket::TLS_Socket) -> Result
Return verify result.
getopts(Tls_socket::TLS_Socket, Options) -> {ok, Option_Values} | {error, posix()}
Gets one or more options for a socket.
handshake(Mode, Socket_Desc, Identity, Peer_Verification, Options) -> any()
is_engine_available(Engine_Name) -> bool()
Tell if Engine_Name
is available.
peername(Tls_socket::TLS_Socket) -> {ok, {Address, Port}} | {error, posix()}
Returns the address and port for the other end of a connection.
quiet_shutdown(Tls_socket::TLS_Socket) -> Socket_Desc
Flag the TLS session as down but do not exchange "close notify".
The underlying socket is NOT closed.recv(TLS_Socket) -> {ok, Orig_Packet} | {error, Reason}
Receive data over a TLS-protected connection.
recv(Tls_socket::TLS_Socket, Timeout) -> {ok, Orig_Packet} | {error, Reason}
Receive data over a TLS-protected connection.
recv_data(Tls_socket::TLS_Socket, Packet) -> {ok, Orig_Packet} | {error, Reason}
Decrypt already received data.
This function won't read anything from the underlying socket but WILL write to it.register_engine(Name, Driver, Auth_Methods) -> ok
Add a new TLS engine.
register_engine(Name, Driver_Path, Driver, Auth_Methods) -> ok
Add a new TLS engine.
send(Tls_socket::TLS_Socket, Packet::Orig_Packet) -> ok | {error, Reason}
Send Orig_Packet
over a TLS-protected connection.
send_data(Tls_socket, Packet) -> any()
setopts(Tls_socket::TLS_Socket, Options) -> ok | {error, posix()}
Sets one or more options for a socket.
shutdown(TLS_Socket) -> Socket_Desc
Shutdown the TLS session.
Only a unidirectional shutdown is made.
The underlying socket is NOT closed.shutdown(TLS_Socket, Mode) -> Socket_Desc
Shutdown the TLS session.
For bidirectional shutdown, there's no timeout for the peer's "close notify".
The underlying socket is NOT closed.shutdown(Tls_socket::TLS_Socket, Mode, Timeout) -> Socket_Desc
Shutdown the TLS session.
For bidirectional shutdown, the peer must send his "close notify" within
Timeout
milliseconds.
If the peer doesn't send its "close notify" or if the underlying socket is closed, the function still succeeds.
The underlying socket is NOT closed by this function.sockname(Tls_socket::TLS_Socket) -> {ok, {Address, Port}} | {error, posix()}
Returns the local address and port number for a socket.
Generated by EDoc, Jul 23 2016, 13:04:35.