SSL(Application)
β¨ SSL Application β¨
Okay bestie, buckle up π the SSL application is literally the glow-up your sockets needed β it provides secure communication over sockets, no cap.
πΈ NAME πΈ
The SSL application β secure communication over sockets, periodt. π«Ά
π¦ SYNOPSIS π¦
It's giving secure sockets, it's giving encrypted vibes, it's giving TLS and DTLS in Erlang. π
π DESCRIPTION π
So like, the ssl application is an implementation of the TLS protocols β which, yes, used to be called SSL, we don't talk about the rebrand era π β and the DTLS protocols, all in Erlang. Iconic behavior only.
For the current statement of standards compliance, go check the User's Guide. π
π Dependencies π
The SSL application is lowkey nothing without its besties: it uses the Public_Key, Asn1, and Crypto applications to handle public keys and encryption. So yeah, those applications must be loaded for the SSL application to work, fr fr.
In an embedded environment, this means they must be started with application:start/1,2 before the SSL application is started. Order matters, bestie β don't skip the pregame. π
π Configuration π
The application environment configuration parameters in this section are defined for the SSL application. For more info about configuration parameters, see the application manual page in Kernel. iykyk β¨
Note π«§ All parameters including the wording session_ticket are TLS-1.3 only configuration, and other session parameters are prior to TLS-1.3 only configuration. DTLS versions are based on TLS versions β see standard compliance for mapping. π
The environment parameters can be set on the command line, for example:
erl -ssl protocol_version "['tlsv1.2', 'tlsv1.1']"
π The Parameters (all of them, we don't skip) π
protocol_version = ssl:tls_version/0 | [ssl:tls_version/0]<optional>β Protocol supported by started clients and servers. If this option is not set, it defaults to all TLS protocols currently supported (more might be configurable) by the SSL application. This option can be overridden by theversionoption tossl:connect/2,3andssl:listen/2. π₯dtls_protocol_version = ssl:dtls_version/0 | [ssl:dtls_version/0]<optional>β Protocol supported by started clients and servers. If this option is not set, it defaults to all DTLS protocols currently supported (more might be configurable) by the SSL application. This option can be overridden by theversionoption tossl:connect/2,3andssl:listen/2. π¦session_lifetime = integer()<optional>β Maximum lifetime of the session data in seconds. Defaults to 24 hours, which is the maximum recommended lifetime by RFC 5246. However, sessions may be invalidated earlier due to the maximum limitation of the session cache table. β³session_cb = atom()<optional>β Deprecated since OTP-23.3, replaced byclient_session_cbandserver_session_cb. π«client_session_cb = atom()<optional>β Since OTP-23.3: name of the client session cache callback module that implements thessl_session_cache_apibehavior. Defaults tossl_client_session_cache_db. πserver_session_cb = atom()<optional>β Since OTP-23.3: name of the server session cache callback module that implements thessl_session_cache_apibehavior. Defaults tossl_server_session_cache_db. πsession_cb_init_args = proplist:proplist()<optional>β Deprecated since OTP-23.3, replaced byclient_session_cb_init_argsandserver_session_cb_init_args. π«client_session_cb_init_args = proplist:proplist()<optional>β List of extra user-defined arguments to theinitfunction in the session cache callback module. Defaults to[]. πserver_session_cb_init_args = proplist:proplist()<optional>β List of extra user-defined arguments to theinitfunction in the session cache callback module. Defaults to[]. πsession_cache_client_max = integer()<optional>β Limits the growth of the client's session cache β that is, how many sessions towards servers are cached to be used by new client connections. If the maximum number of sessions is reached, the current cache entries will be invalidated regardless of their remaining lifetime. Defaults to 1000. Recommendedssl-8.2.1or later for this option to work as intended. πsession_cache_server_max = integer()<optional>β Limits the growth of the server's session cache β that is, how many client sessions are cached by the server. If the maximum number of sessions is reached, the current cache entries will be invalidated regardless of their remaining lifetime. Defaults to 1000. Recommendedssl-8.2.1or later for this option to work as intended. πssl_pem_cache_clean = integer()<optional>β Number of milliseconds between PEM cache validations. Defaults to 2 minutes. β°
Note: the cache can be reloaded by calling ssl:clear_pem_cache/0. β¨
bypass_pem_cache = boolean()<optional>β Introduced inssl-8.0.2. Disables the PEM-cache. Can be used as a workaround for the PEM-cache bottleneck beforessl-8.1.1. Defaults tofalse. πͺalert_timeout = integer()<optional>β Number of milliseconds between sending of a fatal alert and closing the connection. Waiting a little while improves the peer's chances to properly receive the alert so it may shutdown gracefully. Defaults to 5000 milliseconds. πinternal_active_n = integer()<optional>β For TLS connections, this value is used to handle the internal socket. Since the implementation was changed from anactive onceto anactive Nbehavior (N = 100) for performance reasons, this option exists for possible tweaking or restoring of the old behavior (internal_active_n = 1) in unforeseen scenarios. The option will not affect Erlang distribution over TLS, which will always run inactive Nmode. Added inssl-9.1(OTP-21.2). π§server_session_tickets_amount = integer()<optional>β Number of session tickets sent by the server. It must be greater than 0. Defaults to 3. ποΈserver_session_ticket_lifetime = integer()<optional>β Lifetime of session tickets sent by the server. Servers must not use any value greater than 604800 seconds (7 days). Expired tickets are automatically removed. Defaults to 7200 seconds (2 hours). βserver_session_ticket_store_size = integer()<optional>β Sets the maximum size of the server session ticket store (stateful tickets). Defaults to 1000. Size limit is enforced by dropping old tickets. π¦server_session_ticket_max_early_data = integer()<optional>β Sets the maximum size of the early data that the server accepts and also configures itsNewSessionTicketmessages to include this same size limit in theirearly_data_indicationextension. Defaults to 16384. Size limit is enforced by both client and server. πclient_session_ticket_lifetime = pos_integer()<optional>β Lifetime of session tickets in the client ticket store. Expired tickets are automatically removed. Defaults to 7200 seconds (2 hours). βclient_session_ticket_store_size = pos_integer()<optional>β Sets the maximum size of the client session ticket store. Defaults to 1000. Size limit is enforced by dropping old tickets. π¦
π Error Logger and Event Handlers π
The SSL application uses OTP logger. TLS/DTLS alerts are logged on notice level. Unexpected errors are logged on error level. These log entries will by default end up in the default Erlang log. π
The option log_level may be used at run-time to set the log level of a specific TLS connection β which is lowkey handy when you want to use level debug to inspect the TLS handshake setup. π main character debugging energy.
π«Ά See Also π«Ά
applicationπ
And that's the tea, bestie. Go forth and encrypt. πβ¨
β with love, from the ssl application, version ssl 11.7.7, page 6, Ericsson AB π
π¦ where this page comes from
- arch rolling: erlang-core 29.1.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms