SSL library information
These standalone options display information about the cryptographic library capabilities.Show all cipher algorithms available for use with the
--cipher option.Show all message digest algorithms available for use with the
--auth option.Show all TLS ciphers supported by the crypto library. OpenVPN uses TLS to secure the control channel, over which the keys that are used to protect the actual VPN traffic are exchanged.The TLS ciphers will be sorted from highest preference (most secure) to lowest.
Whether a cipher suite in this list can actually work depends on the specific setup of both peers (e.g. both peers must support the cipher, and an ECDSA cipher suite will not work if you are using an RSA certificate).
Show currently available hardware-based crypto acceleration engines supported by the OpenSSL library.
Show all available elliptic curves/groups to use with the
--ecdh-curve and tls-groups options.Generating key material
Generate a key to be used of the specified type. If keyfile is left out or empty, the key will be output on stdout.Syntax:Valid keytype arguments:
secret- Standard OpenVPN shared secret keystls-crypt- Alias forsecrettls-auth- Alias forsecretauth-token- Key used for--auth-gen-token-keytls-crypt-v2-server- TLS Crypt v2 server keytls-crypt-v2-client- TLS Crypt v2 client key
Generating shared secret keys
Generating shared secret keys
Generating TLS Crypt v2 server key
Generating TLS Crypt v2 server key
Generate a
--tls-crypt-v2 key to be used by an OpenVPN server.Generating TLS Crypt v2 client key
Generating TLS Crypt v2 client key
Generate a If supplied, include the supplied
--tls-crypt-v2 key to be used by OpenVPN clients.metadata in the wrapped client key. This metadata must be supplied in base64-encoded form. The metadata must be at most 733 bytes long (980 characters in base64).If no metadata is supplied, OpenVPN will use a 64-bit unix timestamp representing the current time in UTC.A tls-crypt-v2 client key is wrapped using a server key. To generate a client key, you must supply the server key using the
--tls-crypt-v2 option.Data channel cipher negotiation
OpenVPN 2.4 and higher have the capability to negotiate the data cipher that is used to encrypt data packets.When both client and server are running OpenVPN 2.5 or later, the order of the ciphers in the server’s
--data-ciphers list is used to pick the data cipher. The first cipher in that list that is also in the client’s --data-ciphers list is chosen.OpenVPN 2.5 and later behavior
OpenVPN 2.5 and later will only allow the ciphers specified in--data-ciphers. If --data-ciphers is not set, the default is AES-256-GCM:AES-128-GCM.
In OpenVPN 2.6 and later, the default is changed to AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305 when Chacha20-Poly1305 is available.
Blowfish deprecation
The--cipher option defaulted to BF-CBC in OpenVPN 2.4 and older versions. In OpenVPN 2.5 this behavior has changed so that if the --cipher is not explicitly set, it does not allow the weak BF-CBC cipher anymore.
Data channel renegotiation
When running OpenVPN in client/server mode, the data channel will use a separate ephemeral encryption key which is rotated at regular intervals.Renegotiate data channel key after n bytes sent or received (disabled by default with an exception).OpenVPN allows the lifetime of a key to be expressed as a number of bytes encrypted/decrypted, a number of packets, or a number of seconds. A key renegotiation will be forced if any of these three criteria are met by either peer.
If using ciphers with cipher block sizes less than 128-bits,
--reneg-bytes is set to 64MB by default as protection against the SWEET32 attack vector. Explicitly disabling this by setting the value to 0 is HIGHLY DISCOURAGED.Renegotiate data channel key after n packets sent and received (disabled by default).
Renegotiate data channel key after at most The effective
max seconds (default 3600) and at least min seconds (default is 90% of max for servers, and equal to max for clients).Syntax:--reneg-sec value used is per session pseudo-uniform-randomized between min and max.With the default value of 3600, this results in an effective per session value in the range of 3240..3600 seconds for servers, or just 3600 for clients.When using dual-factor authentication, this default value may cause the end user to be challenged to reauthorize once per hour.
TLS mode options
TLS mode is the most powerful crypto mode of OpenVPN in both security and flexibility. TLS mode works by establishing control and data channels which are multiplexed over a single TCP/UDP port.To use TLS mode, each peer that runs OpenVPN should have its own local certificate/key pair (
--cert and --key), signed by the root certificate which is specified in --ca.Certificate authority (CA) file in .pem format, also referred to as the root certificate.This file can have multiple certificates in .pem format, concatenated together. You can construct your own certificate authority certificate and private key by using:
Local peer’s signed certificate in .pem format or as a URI. Must be signed by a certificate authority whose certificate is in
--ca file in the peer configuration.URI is supported only when built with OpenSSL 3.0 or later. Types of URIs supported depend on providers. OpenSSL has internal support for file:/absolute/path URI. PKCS#11 URI (RFC 7512) is supported by pkcs11-provider.Each peer in an OpenVPN link running in TLS mode should have its own certificate and private key file.Example generation:Local peer’s private key in .pem format or a URI. Use the private key which was generated when you built your peer’s certificate.URI is supported only when built with OpenSSL 3.0 or later.
File containing finite field Diffie Hellman parameters in .pem format (used by Diffie Hellman parameters can be generated using:
--tls-server only).Set to none to disable fine field Diffie Hellman key exchange (and to only use ECDH or newer hybrid key agreement algorithms like X25519MLKEM768 instead).Starting with OpenVPN 2.7.0, not specifying
--dh is the same as setting it to none. It is recommended to use none as finite field Diffie Hellman has been replaced by more modern variants like ECDH.Add an additional layer of HMAC authentication on top of the TLS control channel to mitigate DoS attacks and attacks on the TLS stack.Syntax:The file is in OpenVPN static key format which can be generated by
--genkey.The optional direction parameter enables the use of 2 distinct keys (HMAC-send, HMAC-receive), so that each data flow direction has a different HMAC key. When used, one side should use 0 and the other should use 1, or both sides should omit it altogether.--tls-auth is recommended when running OpenVPN in a mode where it is listening for packets from any IP address, such as when --remote is not specified, or --remote is specified with --float.Encrypt and authenticate all control channel packets with the key from keyfile.Encrypting (and authenticating) control channel packets:
- Provides more privacy by hiding the certificate used for the TLS connection
- Makes it harder to identify OpenVPN traffic as such
- Provides “poor-man’s” post-quantum security, against attackers who will never know the pre-shared key (i.e. no forward secrecy)
--tls-auth, --tls-crypt does not require the user to set --key-direction.Use client-specific tls-crypt keys.Syntax:For clients,
keyfile is a client-specific tls-crypt key generated using --genkey tls-crypt-v2-client.For servers, keyfile is used to unwrap client-specific keys supplied by the client during connection setup.The optional force-cookie parameter allows only tls-crypt-v2 clients that support a cookie based stateless three way handshake (OpenVPN 2.6 and later). The option allow-noncookie explicitly allows older tls-crypt-v2 clients.Enable TLS and assume client role during TLS handshake.
Enable TLS and assume server role during TLS handshake.
OpenVPN is designed as a peer-to-peer application. The designation of client or server is only for the purpose of negotiating the TLS control channel.
A list of allowable TLS ciphers delimited by a colon (
:).This setting can be used to ensure that certain cipher suites are used (or not used) for the TLS connection. For OpenSSL, the --tls-cipher option is used for TLS 1.2 and below.Use --show-tls to see a list of TLS ciphers supported by your crypto library.Default for OpenSSL: DEFAULT:!EXP:!LOW:!MEDIUM:!kDH:!kECDH:!DSS:!PSK:!SRP:!kRSASame as
--tls-cipher but for TLS 1.3 and up.mbed TLS has no TLS 1.3 support yet and only the
--tls-cipher setting is used.Sets the minimum TLS version we will accept from the peer (default in 2.6.0 and later is “1.2”).Syntax:Examples for version include
1.0, 1.1, or 1.2. If or-highest is specified and version is not recognized, we will only accept the highest TLS version supported by the local SSL implementation.Set the maximum TLS version we will use (default is the highest version supported).Examples for version include
1.0, 1.1, or 1.2.Require that peer certificate was signed with an explicit key usage and extended key usage based on RFC3280 TLS rules.Valid values:
server- Use on clients to verify they are connecting to a designated serverclient- Use on servers to verify only hosts with a client certificate can connect
This is an important security precaution to protect against a man-in-the-middle attack where an authorized client attempts to connect to another client by impersonating the server.
Accept connections only if a host’s X.509 name is equal to the specified name.Syntax:
type can be:subject- Match the complete subject DN (default)name- Match a subject RDNname-prefix- Match a subject RDN prefix
Specify a SHA256 fingerprint or list of SHA256 fingerprints to verify the peer certificate against.The peer certificate must match one of the fingerprints or certificate verification will fail.Example:
When the
--peer-fingerprint option is used, specifying a CA with --ca or --capath is optional. This allows --peer-fingerprint to be used as an alternative to a PKI with self-signed certificates for small setups.PKCS#11 and SmartCard options
Specify RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) providers to load. A space-separated list of one or more provider library names may be specified.This option along with
--pkcs11-id or pkcs11-id-management can be used instead of --cert and --key or --pkcs12.If p11-kit is present on the system and was enabled during build, its
p11-kit-proxy.so module will be loaded by default if either the --pkcs11-id or --pkcs11-id-management options is present without --pkcs11-providers.Specify the serialized certificate id to be used. The id can be obtained by the standalone
--show-pkcs11-ids option.Show PKCS#11 token object list.Syntax:Specify
cert_private as 1 if certificates are stored as private objects.Specify how many seconds the PIN can be cached. The default is until the token is removed.
Specify which method to use to perform private key operations. Mode is encoded as hex number:
0(default) - Try to determine automatically1- Use sign2- Use sign recover4- Use decrypt8- Use unwrap