From e042afe54727ae490d47eae47c6d9a210f04dd47 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
The following data types are used in the functions for SSL/TLS/DTLS:
- -The default socket options are
-
For valid options, see the
-
Defaults to
Used in socket data message.
Used in socket close message.
Represents a file path.
ASN.1 DER-encoded entity as an Erlang binary.
An opaque reference to the TLS/DTLS connection.
+The default socket options are
+
For valid options, see the
+
opaque()
Tuples and string formats accepted by versions - before ssl-8.2.4 will be converted for backwards compatibility
fun(key_exchange() | cipher() | hash() | aead | default_prf) -> true | false
When an TLS/DTLS socket is in active mode (the default), data from the + socket is delivered to the owner of the socket in the form of + messages as described above.
+Defaults to
The following options have the same meaning in the client and - the server:
+ +Choose TLS or DTLS protocol for the transport layer security.
- Defaults to
Defaults to
The DER-encoded users certificate. If this option
- is supplied, it overrides option
Path to a file containing the user certificate.
The DER-encoded user's private key or a map refering to a crypto
- engine and its key reference that optionally can be password protected,
- seealso
Path to the file containing the user's
- private PEM-encoded key. As PEM-files can contain several
- entries, this option defaults to the same file as given by
- option
String containing the user's password. Only used if the - private keyfile is password-protected.
Supported cipher suites. The function
-
Allows to specify the order of preference for named curves - and to restrict their usage when using a cipher suite supporting them. -
Specifies if to reject renegotiation attempt that does
- not live up to
-
Maximum number of non-self-issued
+ Choose TLS or DTLS protocol for the transport layer security.
+ Defaults to Defaults to The DER-encoded users certificate. If this option
+ is supplied, it overrides option Path to a file containing the user certificate on PEM format. The DER-encoded user's private key or a map refering to a crypto
+ engine and its key reference that optionally can be password protected,
+ seealso Path to the file containing the user's
+ private PEM-encoded key. As PEM-files can contain several
+ entries, this option defaults to the same file as given by
+ option String containing the user's password. Only used if the
+ private keyfile is password-protected. Supported cipher suites. The function
+ Allows to specify the order of preference for named curves
+ and to restrict their usage when using a cipher suite supporting them. Specifies if to reject renegotiation attempt that does
+ not live up to Maximum number of non-self-issued
intermediate certificates that can follow the peer certificate
in a valid certification path. So, if depth is 0 the PEER must
be signed by the trusted ROOT-CA directly; if 1 the path can
be PEER, CA, ROOT-CA; if 2 the path can be PEER, CA, CA,
- ROOT-CA, and so on. The default value is 1.
The verification fun is to be defined as follows:
+ ROOT-CA, and so on. The default value is 1. + + + +The verification fun is to be defined as follows:
fun(OtpCert :: #'OTPCertificate'{}, Event :: {bad_cert, Reason :: atom() | {revoked,
@@ -316,20 +375,21 @@ atom()}} |
The verification fun is called during the X509-path
validation when an error or an extension unknown to the SSL
- application is encountered. It is also called
- when a certificate is considered valid by the path validation
- to allow access to each certificate in the path to the user
- application. It differentiates between the peer
- certificate and the CA certificates by using valid_peer or
- valid as second argument to the verification fun. See the
- public_key User's
- Guide for definition of #'OTPCertificate'{} and
- #'Extension'{} .
+ application is encountered. It is also called when a
+ certificate is considered valid by the path validation to
+ allow access to each certificate in the path to the user
+ application. It differentiates between the peer certificate
+ and the CA certificates by using valid_peer or
+ valid as second argument to the verification fun. See
+ the public_key
+ User's Guide for definition of
+ #'OTPCertificate'{} and #'Extension'{} .
- If the verify callback fun returns {fail, Reason} ,
- the verification process is immediately stopped, an alert is
- sent to the peer, and the TLS/DTLS handshake terminates.
+ If the verify callback fun returns {fail,
+ Reason} , the verification process is immediately
+ stopped, an alert is sent to the peer, and the TLS/DTLS
+ handshake terminates.
If the verify callback fun returns {valid, UserState} ,
the verification process continues.
If the verify callback fun always returns
@@ -379,10 +439,12 @@ atom()}} |
unknown_ca
- No trusted CA was found in the trusted store. The trusted CA is
- normally a so called ROOT CA, which is a self-signed certificate. Trust can
- be claimed for an intermediate CA (trusted anchor does not have to be
- self-signed according to X-509) by using option partial_chain .
+ No trusted CA was found in the trusted store. The
+ trusted CA is normally a so called ROOT CA, which is a
+ self-signed certificate. Trust can be claimed for an
+ intermediate CA (trusted anchor does not have to be
+ self-signed according to X-509) by using option
+ partial_chain .
selfsigned_peer
@@ -393,15 +455,17 @@ atom()}} |
marker="public_key:public_key#pkix_path_validation-3">public_key:pkix_path_validation/3
Perform CRL (Certificate Revocation List) verification
The CA certificates specified for the connection will be used to construct the certificate chain validating the CRLs.
The CRLs will be fetched from a local or external cache. See
Specify how to perform lookup and caching of certificate revocation lists.
-
There are two implementations available:
- -This module maintains a cache of CRLs. CRLs can be
- added to the cache using the function
- Enables fetching of CRLs specified as http URIs in
This module makes use of a directory where CRLs are - stored in files named by the hash of the issuer name.
- -The file names consist of eight hexadecimal digits
- followed by
For a given hash value, this module finds all
- consecutive
The following argument is required:
- -Specifies the directory in which the CRLs can be found.
Integer (24 bits unsigned). Used to limit the size of - valid TLS handshake packets to avoid DoS attacks. - Defaults to 256*1024.
-Claim an intermediate CA in the chain as trusted. TLS then
- performs
Specify how to perform lookup and caching of certificate revocation lists.
+
There are two implementations available:
+ +This module maintains a cache of CRLs. CRLs can be
+ added to the cache using the function
+ Enables fetching of CRLs specified as http URIs in
This module makes use of a directory where CRLs are + stored in files named by the hash of the issuer name.
+ +The file names consist of eight hexadecimal digits
+ followed by
For a given hash value, this module finds all
+ consecutive
The following argument is required:
+ +Specifies the directory in which the CRLs can be found.
+fun(Chain::[public_key:der_encoded()]) ->
+ {trusted_ca, DerCert::public_key:der_encoded()} | unknown_ca}
+
+ Claim an intermediate CA in the chain as trusted. TLS then
+ performs
TLS protocol versions supported by started clients and servers.
+ TLS protocol versions supported by started clients and servers.
This option overrides the application environment option
When an integer-value is specified,
The lookup fun is to defined as follows:
+The lookup fun is to defined as follows:
fun(psk, PSKIdentity ::string(), UserState :: term()) ->
@@ -534,20 +596,54 @@ fun(srp, Username :: string(), UserState :: term()) ->
RFC 5054 :
crypto:sha([Salt, crypto:sha([Username, <<$:>>, Password])])
- Affects TLS-1.0 connections only.
+ Identifies a TLS session. If set to When an integer-value is specified, Integer (24 bits unsigned). Used to limit the size of
+ valid TLS handshake packets to avoid DoS attacks.
+ Defaults to 256*1024. Affects TLS-1.0 connections only.
If set to Using
Affects SSL-3.0 and TLS-1.0 connections only. Used to change the BEAST
+ Affects SSL-3.0 and TLS-1.0 connections only. Used to change the BEAST
mitigation strategy to interoperate with legacy software.
Defaults to Using Using
The following options are client-specific or have a slightly different - meaning in the client than in the server:
+ + + -In mode
In mode
Reuses a specific session earlier saved with the option
-
Reuses a specific session earlier saved with the option
+
When When
The DER-encoded trusted certificates. If this option
- is supplied it overrides option
Path to a file containing PEM-encoded CA certificates. The CA + to previous stored sessions, it will be saved for possible later reuse. Since OTP-21.3
+ + + +The DER-encoded trusted certificates. If this option
+ is supplied it overrides option
Path to a file containing PEM-encoded CA certificates. The CA certificates are used during server authentication and when building the client certificate chain.
-The list of protocols supported by the client to be sent to the - server to be used for an Application-Layer Protocol Negotiation (ALPN). - If the server supports ALPN then it will choose a protocol from this - list; otherwise it will fail the connection with a "no_application_protocol" - alert. A server that does not support ALPN will ignore this value.
- -The list of protocols must not contain an empty binary.
- -The negotiated protocol can be retrieved using the
Indicates that the client is to try to perform Next Protocol - Negotiation.
- -If precedence is server, the negotiated protocol is the - first protocol to be shown on the server advertised list, which is - also on the client preference list.
- -If precedence is client, the negotiated protocol is the - first protocol to be shown on the client preference list, which is - also on the server advertised list.
- -If the client does not support any of the server advertised - protocols or the server does not advertise any protocols, the - client falls back to the first protocol in its list or to the - default protocol (if a default is supplied). If the - server does not support Next Protocol Negotiation, the - connection terminates if no default protocol is supplied.
-Specifies the identity the client presents to the server.
- The matching secret is found by calling
Specifies the username and password to use to authenticate - to the server.
Specify the hostname to be used in TLS Server Name Indication extension.
- If not specified it will default to the
- The
Prevents the Server Name Indication extension from being sent and
- disables the hostname verification check
-
Customizes the hostname verification of the peer certificate, as different protocols that use
+
+
+
+ The list of protocols supported by the client to be sent to the
+ server to be used for an Application-Layer Protocol Negotiation (ALPN).
+ If the server supports ALPN then it will choose a protocol from this
+ list; otherwise it will fail the connection with a "no_application_protocol"
+ alert. A server that does not support ALPN will ignore this value. The list of protocols must not contain an empty binary. The negotiated protocol can be retrieved using the Indicates that the client is to try to perform Next Protocol
+ Negotiation. If precedence is server, the negotiated protocol is the
+ first protocol to be shown on the server advertised list, which is
+ also on the client preference list. If precedence is client, the negotiated protocol is the
+ first protocol to be shown on the client preference list, which is
+ also on the server advertised list. If the client does not support any of the server advertised
+ protocols or the server does not advertise any protocols, the
+ client falls back to the first protocol in its list or to the
+ default protocol (if a default is supplied). If the
+ server does not support Next Protocol Negotiation, the
+ connection terminates if no default protocol is supplied. Specifies the identity the client presents to the server.
+ The matching secret is found by calling Specifies the username and password to use to authenticate
+ to the server. Specify the hostname to be used in TLS Server Name Indication extension.
+ If not specified it will default to the
+ The The special value Customizes the hostname verification of the peer certificate, as different protocols that use
TLS such as HTTP or LDAP may want to do it differently, for possible options see
Send special cipher suite TLS_FALLBACK_SCSV to avoid undesired TLS version downgrade. - Defaults to false
-Note this option is not needed in normal TLS usage and should not be used - to implement new clients. But legacy clients that retries connections in the following manner
- -may use it to avoid undesired TLS version downgrade. Note that TLS_FALLBACK_SCSV must also - be supported by the server for the prevention to work. -
In addition to the algorithms negotiated by the cipher
+
+
+
+ Send special cipher suite TLS_FALLBACK_SCSV to avoid undesired TLS version downgrade.
+ Defaults to false Note this option is not needed in normal TLS usage and should not be used
+ to implement new clients. But legacy clients that retries connections in the following manner may use it to avoid undesired TLS version downgrade. Note that TLS_FALLBACK_SCSV must also
+ be supported by the server for the prevention to work.
+ In addition to the algorithms negotiated by the cipher
suite used for key exchange, payload encryption, message
authentication and pseudo random calculation, the TLS signature
algorithm extension
The following options are server-specific or have a slightly different - meaning in the server than in the client:
+The DER-encoded trusted certificates. If this option
- is supplied it overrides option
The DER-encoded trusted certificates. If this option
+ is supplied it overrides option
Path to a file containing PEM-encoded CA - certificates. The CA certificates are used to build the server - certificate chain and for client authentication. The CAs are - also used in the list of acceptable client CAs passed to the - client when a certificate is requested. Can be omitted if there - is no need to verify the client and if there are no - intermediate CAs for the server certificate.
The DER-encoded Diffie-Hellman parameters. If specified,
- it overrides option
Path to a file containing PEM-encoded Diffie Hellman parameters - to be used by the server if a cipher suite using Diffie Hellman key - exchange is negotiated. If not specified, default parameters are used. -
A server only does x509-path validation in mode
Used together with
The boolean value true specifies that the server will
- agree to reuse sessions. Setting it to false will result in an empty
- session table, that is no sessions will be reused.
- See also option
Enables the TLS/DTLS server to have a local policy
- for deciding if a session is to be reused or not.
- Meaningful only if
Indicates the server will try to perform Application-Layer - Protocol Negotiation (ALPN).
- -The list of protocols is in order of preference. The protocol - negotiated will be the first in the list that matches one of the - protocols advertised by the client. If no protocol matches, the - server will fail the connection with a "no_application_protocol" alert.
- -The negotiated protocol can be retrieved using the
List of protocols to send to the client if the client indicates that
- it supports the Next Protocol extension. The client can select a protocol
- that is not on this list. The list of protocols must not contain an empty
- binary. If the server negotiates a Next Protocol, it can be accessed
- using the
Specifies the server identity hint, which the server presents to - the client.
If set to
If set to
If the server receives a SNI (Server Name Indication) from the client
- matching a host listed in the
If the server receives a SNI (Server Name Indication) from the client,
- the given function will be called to retrieve
The algorithms specified by
- this option will be the ones accepted by the server in a signature algorithm
- negotiation, introduced in TLS-1.2. The algorithms will also be offered to the client if a
- client certificate is requested. For more details see the
Path to a file containing PEM-encoded CA + certificates. The CA certificates are used to build the server + certificate chain and for client authentication. The CAs are + also used in the list of acceptable client CAs passed to the + client when a certificate is requested. Can be omitted if + there is no need to verify the client and if there are no + intermediate CAs for the server certificate.
+The DER-encoded Diffie-Hellman parameters. If
+ specified, it overrides option
Path to a file containing PEM-encoded Diffie Hellman + parameters to be used by the server if a cipher suite using + Diffie Hellman key exchange is negotiated. If not specified, + default parameters are used.
+When an TLS/DTLS socket is in active mode (the default), data from the - socket is delivered to the owner of the socket in the form of - messages:
-A server only does x509-path validation in mode
+
Used together with
The boolean value true specifies that the server will
+ agree to reuse sessions. Setting it to false will result in an empty
+ session table, that is no sessions will be reused.
+ See also option
Enables the TLS/DTLS server to have a local policy
+ for deciding if a session is to be reused or not. Meaningful
+ only if
Indicates the server will try to perform + Application-Layer Protocol Negotiation (ALPN).
+ +The list of protocols is in order of preference. The + protocol negotiated will be the first in the list that + matches one of the protocols advertised by the client. If no + protocol matches, the server will fail the connection with a + "no_application_protocol" alert.
+ +The negotiated protocol can be retrieved using the
+
List of protocols to send to the client if the client
+ indicates that it supports the Next Protocol extension. The
+ client can select a protocol that is not on this list. The
+ list of protocols must not contain an empty binary. If the
+ server negotiates a Next Protocol, it can be accessed using
+ the
Specifies the server identity hint, which the server presents to + the client.
+If set to
If the server receives a SNI (Server Name Indication) from the client
+ matching a host listed in the
If the server receives a SNI (Server Name Indication)
+ from the client, the given function will be called to
+ retrieve
In protocols that support client-initiated
+ renegotiation, the cost of resources of such an operation is
+ higher for the server than the client. This can act as a
+ vector for denial of service attacks. The SSL application
+ already takes measures to counter-act such attempts, but
+ client-initiated renegotiation can be strictly disabled by
+ setting this option to
If true, use the server's preference for cipher + selection. If false (the default), use the client's + preference.
+If true, use the server's preference for ECC curve + selection. If false (the default), use the client's + preference.
+ The algorithms specified by this option will be the
+ ones accepted by the server in a signature algorithm
+ negotiation, introduced in TLS-1.2. The algorithms will also
+ be offered to the client if a client certificate is
+ requested. For more details see the
A
Make Returns all default or all supported (except anonymous),
or all anonymous cipher suites for a
@@ -932,9 +1105,15 @@ fun(srp, Username :: string(), UserState :: term()) ->
Returns a list of supported ECCs. Upgrades a If the option If the option If the option If the option Opens an TLS/DTLS connection to When the option If the option
Closes an TLS/DTLS connection.
@@ -1048,7 +1239,7 @@ fun(srp, Username :: string(), UserState :: term()) ->Removes cipher suites if any of the filter functions
returns false for any part of the cipher suite. This function
@@ -1149,7 +1340,7 @@ fun(srp, Username :: string(), UserState :: term()) ->
{ok, [socketoption()]} | {error, Reason}
Performs the SSL/TLS/DTLS server-side handshake. Returns a new TLS/DTLS socket if the handshake is successful. If the option If If If
If the option
Cancel the handshake with a fatal
Continue the SSL/TLS handshake possiby with new, additional or changed options.
@@ -1260,9 +1463,9 @@ fun(srp, Username :: string(), UserState :: term()) -> {ok, ListenSocket} | {error, Reason}Creates an SSL listen socket.
@@ -1273,7 +1476,7 @@ fun(srp, Username :: string(), UserState :: term()) ->Returns the address and port number of the peer.
@@ -1316,8 +1519,9 @@ fun(srp, Username :: string(), UserState :: term()) ->Make Initiates a new handshake. A notable return value is
Sets options according to Deprecated in OTP 21, use
Deprecated in OTP 21, use
Returns the local address and port number of socket
@@ -1504,7 +1708,7 @@ fun(srp, Username :: string(), UserState :: term()) ->
Delete CRLs from the ssl applications local cache.
@@ -53,13 +65,12 @@Insert CRLs into the ssl applications local cache.
+Insert CRLs, available to fetch on DER format from
The following data types are used in the functions below: -
- -#'DistributionPoint'{} see
Reference to the CRL cache.
+For description see
Lookup the CRLs belonging to the distribution point Select the CRLs in the cache that are issued by The following data types are used in the functions for
- A key to an entry in the session cache. The opaque part of the key. Does not need to be handled
+ by the callback. The session data that is stored for each session. Deletes a cache entry. Is only called from the cache
@@ -83,7 +94,9 @@
Calls
Includes property Looks up a cache entry. Is to be callable from any
@@ -136,12 +150,12 @@
Selects sessions that can be reused. Is to be callable
@@ -154,7 +168,7 @@
Returns the number of sessions in the cache. If size
@@ -170,7 +184,8 @@
Takes care of possible cleanup that is needed when the
@@ -183,9 +198,9 @@
Caches a new session or updates an already cached one. Is
--
cgit v1.2.3