Module fast_tls

Data Types

cert()

cert() = #'Certificate'{} | #'OTPCertificate'{}

tls_socket()

tls_socket() = #tlssock{tcpsock = inet:socket(), tlsport = port()}

Function Index

add_certfile/2
clear_cache/0Clears cached SSL_CTX structures You MUST call this function if you change content of your CA, DH or certificate files.
close/1
controlling_process/2
delete_certfile/1Returns true if element is deleted, false otherwise.
finish_handshake/2
get_cert_verify_string/2
get_certfile/1This function is intended for tests only.
get_fips_mode/0Checks whether FIPS mode is enabled or not.
get_fips_mode_nif/0
get_negotiated_cipher/1
get_negotiated_cipher_nif/1
get_peer_certificate/1
get_peer_certificate/2
get_peer_certificate_nif/1
get_tls_cb_exporter/1
get_tls_cb_exporter_nif/1
get_tls_last_message/2
get_verify_result/1
get_verify_result_nif/1
invalidate_nif/1
loop_nif/4
open_nif/10
p12_to_pem/2Converts PKCS12 certificate to PEM encoded private key and certificate.
p12_to_pem_nif/2
peername/1
recv/2
recv/3
recv_data/2
send/2
set_fips_mode/1Enables/disables FIPS mode.
set_fips_mode_nif/1
setopts/2
sockname/1
tcp_to_tls/2
tls_to_tcp/1

Function Details

add_certfile/2

add_certfile(Domain::iodata(), File::iodata()) -> ok

clear_cache/0

clear_cache() -> ok

Clears cached SSL_CTX structures You MUST call this function if you change content of your CA, DH or certificate files

close/1

close(Tlssock) -> any()

controlling_process/2

controlling_process(Tlssock, Pid) -> any()

delete_certfile/1

delete_certfile(Domain::iodata()) -> boolean()

Returns true if element is deleted, false otherwise

finish_handshake/2

finish_handshake(Tlssock::tls_socket(), Timeout::timeout()) -> {error, inet:posix() | binary()} | ok

get_cert_verify_string/2

get_cert_verify_string(CertVerifyRes::number(), Cert::cert() | binary()) -> binary()

get_certfile/1

get_certfile(Domain::iodata()) -> {ok, binary()} | error

This function is intended for tests only

get_fips_mode/0

get_fips_mode() -> boolean()

Checks whether FIPS mode is enabled or not

get_fips_mode_nif/0

get_fips_mode_nif() -> any()

get_negotiated_cipher/1

get_negotiated_cipher(Tlssock::tls_socket()) -> error | {ok, binary()}

get_negotiated_cipher_nif/1

get_negotiated_cipher_nif(Port) -> any()

get_peer_certificate/1

get_peer_certificate(TLSSock::tls_socket()) -> {ok, cert()} | error

get_peer_certificate/2

get_peer_certificate(Tlssock::tls_socket(), Type::otp | plain) -> {ok, cert()} | error

get_peer_certificate(Tlssock::tls_socket(), Type::der) -> {ok, binary()} | error

get_peer_certificate_nif/1

get_peer_certificate_nif(Port) -> any()

get_tls_cb_exporter/1

get_tls_cb_exporter(Tlssock::tls_socket()) -> {ok, binary()} | {error, term()}

get_tls_cb_exporter_nif/1

get_tls_cb_exporter_nif(Port) -> any()

get_tls_last_message/2

get_tls_last_message(X1::peer | self, Tlssock::tls_socket()) -> {ok, binary()} | {error, term()}

get_verify_result/1

get_verify_result(Tlssock::tls_socket()) -> byte()

get_verify_result_nif/1

get_verify_result_nif(Port) -> any()

invalidate_nif/1

invalidate_nif(Port) -> any()

loop_nif/4

loop_nif(Port, ToSend, Received, ReceiveBytes) -> any()

open_nif/10

open_nif(Flags, CertFile, KeyFile, Ciphers, ProtocolOpts, DH, DHFile, CAFile, SNI, ALPN) -> any()

p12_to_pem/2

p12_to_pem(P12Data::binary(), Pass::binary()) -> {ok, {binary(), binary()}} | {error, atom() | binary()}

Converts PKCS12 certificate to PEM encoded private key and certificate

p12_to_pem_nif/2

p12_to_pem_nif(P12Data, Pass) -> any()

peername/1

peername(Tlssock) -> any()

recv/2

recv(Socket::tls_socket(), Length::non_neg_integer()) -> {error, inet:posix()} | {error, binary()} | {ok, binary()}

recv/3

recv(TLSSock::tls_socket(), Length::non_neg_integer(), Timeout::timeout()) -> {error, inet:posix()} | {error, binary()} | {ok, binary()}

recv_data/2

recv_data(TLSSock::tls_socket(), Packet::binary()) -> {error, inet:posix() | binary()} | {ok, binary()}

send/2

send(Socket::tls_socket(), Packet::binary()) -> ok | {error, inet:posix() | binary() | timeout}

set_fips_mode/1

set_fips_mode(X1::boolean()) -> ok | {error, binary()}

Enables/disables FIPS mode

set_fips_mode_nif/1

set_fips_mode_nif(Flag) -> any()

setopts/2

setopts(Tlssock::tls_socket(), Opts::list()) -> ok | {error, inet:posix()}

sockname/1

sockname(Tlssock::tls_socket()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, inet:posix()}

tcp_to_tls/2

tcp_to_tls(TCPSocket::inet:socket(), Options::[atom() | {atom(), any()}]) -> {ok, tls_socket()} | {error, no_certfile | binary()}

tls_to_tcp/1

tls_to_tcp(Tlssock::tls_socket()) -> inet:socket()


Generated by EDoc