<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kurt</id>
	<title>OpenSSLWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kurt"/>
	<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php/Special:Contributions/Kurt"/>
	<updated>2026-05-12T13:59:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2729</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2729"/>
		<updated>2018-10-07T16:47:40Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Non-application data records */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
Applications should use the SSL_CTX_set_ciphersuites() or SSL_set_ciphersuites() functions to configure TLSv1.3 ciphersuites. Note that the functions SSL_CTX_get_ciphers() and SSL_get_ciphers() will return&lt;br /&gt;
the full list of ciphersuites that have been configured for both TLSv1.2 and below and TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the [https://www.openssl.org/docs/manmaster/man3/SSL_get1_session.html SSL_get1_session()] function (or similar).&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_remove_session.html SSL_CTX_remove_session()] to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session(). Calling SSL_get1_session() after a 2 way shutdown will give a resumable session if any was sent. You can check that a session is resumable with [https://www.openssl.org/docs/manmaster/man3/SSL_SESSION_is_resumable.html SSL_SESSION_is_resumable()].&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_sess_set_new_cb.html SSL_CTX_sess_set_new_cb()] API instead. This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. The number of tickets can be set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_num_tickets.html SSL_CTX_set_num_tickets]. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
If a client sends it's data and directly sends the close notify request and closes the connection, the server will still try to send tickets if configured to do so. Since the connection is already closed by the client, this might result in a write error and receiving the SIGPIPE signal. The write error will be ignored if it's a session ticket. But server applications can still get SIGPIPE they didn't get before.&lt;br /&gt;
&lt;br /&gt;
If the server sends session tickets and you want to be able to get a resumable session, you need to either call SSL_read() after the ticket was sent or do a 2 way shutdown.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/manmaster/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2722</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2722"/>
		<updated>2018-09-05T20:58:47Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Sessions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the [https://www.openssl.org/docs/manmaster/man3/SSL_get1_session.html SSL_get1_session()] function (or similar).&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_remove_session.html SSL_CTX_remove_session()] to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session(). Calling SSL_get1_session() after a 2 way shutdown will give a resumable session if any was sent. You can check that a session is resumable with [https://www.openssl.org/docs/manmaster/man3/SSL_SESSION_is_resumable.html SSL_SESSION_is_resumable()].&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_sess_set_new_cb.html SSL_CTX_sess_set_new_cb()] API instead. This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. The number of tickets can be set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_num_tickets.html SSL_CTX_set_num_tickets]. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
If a client sends it's data and directly sends the close notify request and closes the connection, the server will still try to send tickets if configured to do so. Since the connection is already closed by the client, this might result in a write error and receiving the SIGPIPE signal. The write error will be ignored if it's a session ticket. But server applications can still get SIGPIPE they didn't get before.&lt;br /&gt;
&lt;br /&gt;
If the server sends session tickets and you want to be able to get a resumable session, you need to either call SSL_read() after the ticket was sent or do a 2 way shutdown.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/manmaster/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using non-blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2721</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2721"/>
		<updated>2018-09-05T20:50:16Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Sessions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the [https://www.openssl.org/docs/manmaster/man3/SSL_get1_session.html SSL_get1_session()] function (or similar).&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_remove_session.html SSL_CTX_remove_session()] to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session(). Calling SSL_get1_session() after a 2 way shutdown will give a resumable session if any was sent. You can check that a session is resumable with [https://www.openssl.org/docs/manmaster/man3/SSL_SESSION_is_resumable.html SSL_SESSION_is_resumable()].&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_sess_set_new_cb.html SSL_CTX_sess_set_new_cb()] API instead. This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. The number of tickets can be set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_num_tickets.html SSL_CTX_set_num_tickets]. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
If a client sends it's data and directly sends the close notify request and closes the connection, the server will still try to send tickets if configured to do so. Since the connection is already closed by the client, this might result in a write error and receiving the SIGPIPE signal. The write error will be ignored if it's a session ticket. But server applications can still get SIGPIPE they didn't get before.&lt;br /&gt;
&lt;br /&gt;
To be able to get a resumable session, you need to either call SSL_read() or do 2 way shutdown.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/manmaster/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using non-blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2720</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2720"/>
		<updated>2018-09-05T20:04:45Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Sessions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the [https://www.openssl.org/docs/manmaster/man3/SSL_get1_session.html SSL_get1_session()] function (or similar).&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_remove_session.html SSL_CTX_remove_session()] to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session(). Calling SSL_get1_session() after a 2 way shutdown will give a resumable session if any was sent. You can check that a session is resumable with [https://www.openssl.org/docs/manmaster/man3/SSL_SESSION_is_resumable.html SSL_SESSION_is_resumable()].&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_sess_set_new_cb.html SSL_CTX_sess_set_new_cb()] API instead. This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. The number of tickets can be set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_num_tickets.html SSL_CTX_set_num_tickets]. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
If a client sends it's data and directly sends the close notify request and closes the connection, the server will still try to send tickets if configured to do so. Since the connection is already closed by the client, this might result in a write error and receiving the SIGPIPE signal. The write error will be ignored if it's a session ticket. But server applications can still get SIGPIPE they didn't get before.&lt;br /&gt;
&lt;br /&gt;
In TLS 1.2 and earlier, sending data, sending the close notify and closing the connection without reading anything or waiting for the close notify from the peer still created a resumable session. Since the session ticket is send after the negotiation in TLS 1.3, you need to make sure that the session ticket message from the server is processed by either calling SSL_read() or doing a 2 way shut shutdown.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/manmaster/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using non-blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2718</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2718"/>
		<updated>2018-08-26T19:54:58Z</updated>

		<summary type="html">&lt;p&gt;Kurt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the [https://www.openssl.org/docs/manmaster/man3/SSL_get1_session.html SSL_get1_session()] function (or similar).&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_remove_session.html SSL_CTX_remove_session()] to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session(). Calling SSL_get1_session() after a 2 way shutdown will give a resumable session if any was sent. You can check that a session is resumable with [https://www.openssl.org/docs/manmaster/man3/SSL_SESSION_is_resumable.html SSL_SESSION_is_resumable()].&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_sess_set_new_cb.html SSL_CTX_sess_set_new_cb()] API instead. This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. The number of tickets can be set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_num_tickets.html SSL_CTX_set_num_tickets]. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL client will only process received sessions when they attempt to read application data. During the read if a session ticket message is encountered then it will be automatically processed. A consequence of this is that if a client application never attempts to read data from the server then it will never receive a session and hence resumption will not be possible. For that reason, if session resumption is required, then it is recommended that clients always perform at least one read between establishing and shutting down a connection.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/manmaster/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/manmaster/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using non-blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2717</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2717"/>
		<updated>2018-08-26T19:51:51Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Sessions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the [https://www.openssl.org/docs/man1.1.1/man3/SSL_get1_session.html SSL_get1_session()] function (or similar).&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_remove_session.html SSL_CTX_remove_session()] to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session(). Calling SSL_get1_session() after a 2 way shutdown will give a resumable session if any was sent. You can check that a session is resumable with [https://www.openssl.org/docs/man1.1.1/man3/SSL_SESSION_is_resumable.html SSL_SESSION_is_resumable()].&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_sess_set_new_cb.html SSL_CTX_sess_set_new_cb()] API instead. This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. The number of tickets can be set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_num_tickets.html SSL_CTX_set_num_tickets]. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL client will only process received sessions when they attempt to read application data. During the read if a session ticket message is encountered then it will be automatically processed. A consequence of this is that if a client application never attempts to read data from the server then it will never receive a session and hence resumption will not be possible. For that reason, if session resumption is required, then it is recommended that clients always perform at least one read between establishing and shutting down a connection.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/man1.1.1/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using non-blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2716</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2716"/>
		<updated>2018-08-26T11:28:20Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Non-application data records */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the SSL_get1_session() function (or similar). See [https://www.openssl.org/docs/man1.1.1/man3/SSL_get1_session.html here] for further details.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use SSL_CTX_remove_session() to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session().&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the SSL_CTX_sess_set_new_cb() API instead (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_sess_set_new_cb.html here]). This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL client will only process received sessions when they attempt to read application data. During the read if a session ticket message is encountered then it will be automatically processed. A consequence of this is that if a client application never attempts to read data from the server then it will never receive a session and hence resumption will not be possible. For that reason, if session resumption is required, then it is recommended that clients always perform at least one read between establishing and shutting down a connection.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/man1.1.1/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket and possibly a key update is send after the finished message. With TLSv1.2 it happened in case of renegotiation. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using non-blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2715</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2715"/>
		<updated>2018-08-26T10:48:30Z</updated>

		<summary type="html">&lt;p&gt;Kurt: Add section about non-application data&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
The TLSv1.3 standard has now been published as [[https://tools.ietf.org/html/rfc8446 RFC 8446]]. During the development of the standard the TLS Working Group published various draft versions. Implementations of draft versions of the standard identify the specific draft version that they are using. This means that implementations based on different draft versions, and also the final RFC version, do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
The OpenSSL git master branch (and the 1.1.1-pre9 beta version) contain our development TLSv1.3 code which is based on the final version of RFC8446 and can be used for testing purposes (i.e. it is not for production use). Earlier beta versions of OpenSSL 1.1.1 implemented draft versions of the standard. Those versions contained the macro TLS1_3_VERSION_DRAFT_TXT in the tls1.h header file which identified the specific draft version that was implemented. This macro has been removed from 1.1.1-pre9 and the current master branch.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Although the latest 1.1.1 versions support the final standard version, other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS_AES_256_GCM_SHA384&lt;br /&gt;
* TLS_CHACHA20_POLY1305_SHA256&lt;br /&gt;
* TLS_AES_128_GCM_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_8_SHA256&lt;br /&gt;
* TLS_AES_128_CCM_SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS_AES_256_GCM_SHA384 and TLS_CHACHA20_POLY1305_SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the SSL_get1_session() function (or similar). See [https://www.openssl.org/docs/man1.1.1/man3/SSL_get1_session.html here] for further details.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use SSL_CTX_remove_session() to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce single use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session().&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the SSL_CTX_sess_set_new_cb() API instead (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_sess_set_new_cb.html here]). This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in previous versions of OpenSSL. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL client will only process received sessions when they attempt to read application data. During the read if a session ticket message is encountered then it will be automatically processed. A consequence of this is that if a client application never attempts to read data from the server then it will never receive a session and hence resumption will not be possible. For that reason, if session resumption is required, then it is recommended that clients always perform at least one read between establishing and shutting down a connection.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. From OpenSSL 1.1.0 and above ciphersuites for TLSv1.2 and below based on DSA are no longer available by default (you must compile OpenSSL with the &amp;quot;enable-weak-ssl-ciphers&amp;quot; option, and explicitly configure the ciphersuites at run time). If your server application is using a DSA certificate and has made the necessary configuration changes to enable the ciphersuites then TLSv1.3 will never be negotiated when that certificate is used for a connection (the maximum version will be TLSv1.2).&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be sent depending on the hostname that was sent in the SNI extension. If the SNI extension is not sent the server's options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some sites want to encourage the use of SNI and configure a default certificate that fails WebPKI authentication  when the client supports TLS 1.3. This is under the assumption that if a hostname is not sent, then it means that the client does not verify the server certificate (unauthenticated opportunistic TLS). For implementation that actually don't send the SNI extension, but do verify the server certificate this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/man1.1.1/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== PSKs ==&lt;br /&gt;
&lt;br /&gt;
Pre-shared Keys work differently in TLSv1.2 and below compared to TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 (and below) special PSK specific ciphersuites are used. A client wishing to use a PSK will offer one (or more) of those ciphersuites to the server in the initial ClientHello message. If the server also wishes to use a PSK, then it will select that ciphersuite and will (optionally) send back an &amp;quot;identity hint&amp;quot; to the client. Finally the client sends back to the server identity details so that the server knows which PSK to use. In OpenSSL 1.1.0 and below this is implemented using a callback mechanism. The callback is called passing in the identity hint (or NULL if there is no hint) and the callback responds by filling in the identity details, as well as the PSK itself.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3, if a client wishes to use a PSK, then the identity details are sent immediately in the initial ClientHello message. Use of a PSK is independent of any ciphersuite selection. If the server wishes to use the PSK then it will signal this in its response to the client. Otherwise a full (non-PSK) handshake will occur. Note that there is no identity hint in TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 introduces new TLSv1.3 specific PSK callbacks. See [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_psk_use_session_callback.html here] and [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_psk_find_session_callback.html here] for further details. These are the preferred callbacks to use for TLSv1.3 PSKs. However, if an application has set up the TLSv1.2 PSK callbacks and TLSv1.3 is enabled then OpenSSL will attempt to fallback to using the old style callbacks. In this case, on the client side, the callback will be invoked before any communication with the server has taken place during construction of the initial ClientHello. This is because the identity details must be sent immediately in TLSv1.3. The identity hint value will always be NULL in this case.&lt;br /&gt;
&lt;br /&gt;
Note that the TLSv1.2 callbacks could end up being called twice for the same connection. For example if a client application provides no TLSv1.3 callback and TLSv1.3 is enabled, then it will be called first during the initial ClientHello construction. If the server subsequently selects TLSv1.2 then the callback will be called again later on in the handshake to set up the TLSv1.2 PSK.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 PSKs must specify a message digest (e.g. such as SHA-256). Where old style TLSv1.2 callbacks are used in a TLSv1.3 context then the message digest will default to SHA-256 (as specified in the standard). A server which has been configured with TLSv1.2 PSK callbacks, but negotiates TLSv1.3 with a client, will prefer ciphersuites based on SHA-256 in order to maximise the chances of a PSK being used.&lt;br /&gt;
&lt;br /&gt;
== Non-application data records ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 sends more non-application data records after the handshake is finished. At least the session ticket is send after the finished message. [https://www.openssl.org/docs/manmaster/man3/SSL_read.html SSL_read()] has always documented that it can return SSL_ERROR_WANT_READ after processing non-application data, even when there is still data that can be read. When SSL_MODE_AUTO_RETRY is set using [https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_mode.html SSL_CTX_set_mode()] OpenSSL will try to process the next record, and so not return SSL_ERROR_WANT_READ while it still has data available. Because many applications did not handle this properly, SSL_MODE_AUTO_RETRY has been made the default. If the application is using non-blocking sockets and SSL_MODE_AUTO_RETRY is enabled, and select() is used to check if a socket is readable this results in SSL_read() processing the non-application data records, but then try to read an application data record which might not be available and hang.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2663</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2663"/>
		<updated>2018-04-27T22:42:47Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Server Name Indication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
As of the time of writing TLSv1.3 is still in draft. Periodically a new version of the draft standard is published by the TLS Working Group. Implementations of the draft are required to identify the specific draft version that they are using. This means that implementations based on different draft versions do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 will not be released until (at least) TLSv1.3 is finalised. In the meantime the OpenSSL git master branch contains our development TLSv1.3 code which can be used for testing purposes (i.e. it is not for production use). You can check which draft TLSv1.3 version is implemented in any particular OpenSSL checkout by examining the value of the TLS1_3_VERSION_DRAFT_TXT macro in the tls1.h header file. This macro will be removed when the final version of the standard is released.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Currently OpenSSL has implemented the “draft-26” version of TLSv1.3. Other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS13-AES-256-GCM-SHA384&lt;br /&gt;
* TLS13-CHACHA20-POLY1305-SHA256&lt;br /&gt;
* TLS13-AES-128-GCM-SHA256&lt;br /&gt;
* TLS13-AES-128-CCM-8-SHA256&lt;br /&gt;
* TLS13-AES-128-CCM-SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS13-AES-256-GCM-SHA384 and TLS13-CHACHA20-POLY1305-SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. At the time of writing, OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the SSL_get1_session() function (or similar). See [https://www.openssl.org/docs/man1.1.1/man3/SSL_get1_session.html here] for further details.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use SSL_CTX_remove_session() to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce singly use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session().&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the SSL_CTX_sess_set_new_cb() API instead (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_sess_set_new_cb.html here]). This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in OpenSSL 1.1.0. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. If your server application is using a DSA certificate then TLSv1.3 connections will fail with an error message similar to the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
140348850206144:error:14201076:SSL routines:tls_choose_sigalg:no suitable signature algorithm:ssl/t1_lib.c:2308:&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be send depending on the hostname that was send in the SNI extension. If an SNI is not send the options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some people want to encourage the use of SNI and set up the default certificate to be for an invalid hostname if the client supports TLS 1.3. This is under the assumption that if a hostname is not send, that the client will check that the hostname of the certificate matches the hostname it's trying to connect to. For implementation that actually don't send the SNI, but do check the hostname this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/man1.1.1/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function. For hostname validation see [[Hostname_validation|Hostname validation]].&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2662</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2662"/>
		<updated>2018-04-27T21:27:53Z</updated>

		<summary type="html">&lt;p&gt;Kurt: Add SNI section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections and the new ones cannot be used in TLSv1.2 and below.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
As of the time of writing TLSv1.3 is still in draft. Periodically a new version of the draft standard is published by the TLS Working Group. Implementations of the draft are required to identify the specific draft version that they are using. This means that implementations based on different draft versions do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 will not be released until (at least) TLSv1.3 is finalised. In the meantime the OpenSSL git master branch contains our development TLSv1.3 code which can be used for testing purposes (i.e. it is not for production use). You can check which draft TLSv1.3 version is implemented in any particular OpenSSL checkout by examining the value of the TLS1_3_VERSION_DRAFT_TXT macro in the tls1.h header file. This macro will be removed when the final version of the standard is released.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Currently OpenSSL has implemented the “draft-26” version of TLSv1.3. Other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS13-AES-256-GCM-SHA384&lt;br /&gt;
* TLS13-CHACHA20-POLY1305-SHA256&lt;br /&gt;
* TLS13-AES-128-GCM-SHA256&lt;br /&gt;
* TLS13-AES-128-CCM-8-SHA256&lt;br /&gt;
* TLS13-AES-128-CCM-SHA256&lt;br /&gt;
&lt;br /&gt;
Due to the major differences between the way that ciphersuites for TLSv1.2 and below and ciphersuites for TLSv1.3 work, they are configured in OpenSSL differently too.&lt;br /&gt;
&lt;br /&gt;
By default the first three of the above ciphersuites are enabled by default. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3. Note that changing the TLSv1.2 and below cipher list has no impact on the TLSv1.3 ciphersuite configuration.&lt;br /&gt;
&lt;br /&gt;
For the OpenSSL command line applications there is a new &amp;quot;-ciphersuites&amp;quot; option to configure the TLSv1.3 ciphersuite list. This is just a simple colon (&amp;quot;:&amp;quot;) separated list of TLSv1.3 ciphersuite names in preference order. Note that you cannot use the special characters such as &amp;quot;+&amp;quot;, &amp;quot;!&amp;quot;, &amp;quot;-&amp;quot; etc, that you can for defining TLSv1.2 ciphersuites. In practice this is not likely to be a problem because there are only a very small number of TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
$ openssl s_server -cert mycert.pem -key mykey.pem -cipher ECDHE -ciphersuites &amp;quot;TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will configure OpenSSL to use any ECDHE based ciphersuites for TLSv1.2 and below. For TLSv1.3 the TLS13-AES-256-GCM-SHA384 and TLS13-CHACHA20-POLY1305-SHA256 ciphersuites will be available.&lt;br /&gt;
&lt;br /&gt;
Note that all of the above applies to the &amp;quot;ciphers&amp;quot; command line application as well. This can sometimes lead to surprising results. For example this command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v ECDHE&lt;br /&gt;
&lt;br /&gt;
Will list all the ciphersuites for TLSv1.2 and below that support ECDHE '''and''' additionally all of the default TLSv1.3 ciphersuites. Use the &amp;quot;-ciphersuites&amp;quot; option to further configure the TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. At the time of writing, OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set1_groups.html here] for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS here]).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the SSL_get1_session() function (or similar). See [https://www.openssl.org/docs/man1.1.1/man3/SSL_get1_session.html here] for further details.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this may not be enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use SSL_CTX_remove_session() to mark a session as non-resumable (and remove it from the cache) once it has been used. OpenSSL servers that accept &amp;quot;early_data&amp;quot; will automatically enforce singly use sessions. Any attempt to resume with a session that has already been used will fallback to a full handshake.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session().&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the SSL_CTX_sess_set_new_cb() API instead (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_sess_set_new_cb.html here]). This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in OpenSSL 1.1.0. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_add_custom_ext.html here] for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_use_serverinfo.html here] for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_key_update.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_verify_client_post_handshake.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. If your server application is using a DSA certificate then TLSv1.3 connections will fail with an error message similar to the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
140348850206144:error:14201076:SSL routines:tls_choose_sigalg:no suitable signature algorithm:ssl/t1_lib.c:2308:&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see [https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_clear_options.html here] for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Server Name Indication ==&lt;br /&gt;
&lt;br /&gt;
Server Name Indication (SNI) can be used by the client to select one of several sites on the same host, and so a different X.509 certificate can be send depending on the hostname that was send in the SNI extension. If an SNI is not send the options are to either disconnect or select a default hostname and matching certificate. The default would typically be the main site.&lt;br /&gt;
&lt;br /&gt;
SNI has been made mandatory to implement in TLS 1.3 but not mandatory to use. Some people want to encourage the use of SNI and set up the default certificate to be for an invalid hostname if the client supports TLS 1.3. This is under the assumption that if a hostname is not send, that the client will check that the hostname of the certificate matches the hostname it's trying to connect to. For implementation that actually don't send the SNI, but do check the hostname this can cause connection failures.&lt;br /&gt;
&lt;br /&gt;
To enable SNI you need to use the [https://www.openssl.org/docs/man1.1.1/man3/SSL_set_tlsext_host_name.html SSL_set_tlsext_host_name()] function.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Main_Page&amp;diff=2652</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Main_Page&amp;diff=2652"/>
		<updated>2018-04-20T08:10:17Z</updated>

		<summary type="html">&lt;p&gt;Kurt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the OpenSSL wiki.  The main site is https://www.openssl.org . If this is your first visit or to get an account please see the [[Welcome]] page. Your participation and [[Contributions]] are valued.&lt;br /&gt;
&lt;br /&gt;
This wiki is intended as a place for collecting, organizing, and refining useful information about OpenSSL that is currently strewn among multiple locations and formats.&lt;br /&gt;
&lt;br /&gt;
== OpenSSL Quick Links ==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;TABLE border=0&amp;gt;&lt;br /&gt;
     &amp;lt;TR&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[OpenSSL Overview]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Compilation and Installation]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Internals]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Mailing Lists]] &amp;lt;/TD&amp;gt;&lt;br /&gt;
      &amp;lt;/TR&amp;gt;&lt;br /&gt;
      &amp;lt;TR&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[libcrypto API]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[libssl API]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Examples]] &amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Documentation Index|Index of all API functions]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
      &amp;lt;/TR&amp;gt;&lt;br /&gt;
      &amp;lt;TR&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[License]] &amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Command Line Utilities]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Related Links]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Binaries]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
      &amp;lt;/TR&amp;gt;&lt;br /&gt;
      &amp;lt;TR&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[SSL and TLS Protocols]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[1.1 API Changes]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[FIPS modules]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[TLS1.3]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
      &amp;lt;/TR&amp;gt;&lt;br /&gt;
  &amp;lt;/TABLE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Administrivia ==&lt;br /&gt;
Site guidelines, legal and admininstrative issues.&lt;br /&gt;
:* [[Basic rules]], [[Commercial Product Disclaimer]], [[Contributions]], [[Copyright]], [[License]]&lt;br /&gt;
:* Using This Wiki&lt;br /&gt;
:: [http://meta.wikimedia.org/wiki/Help:Contents Wiki User's Guide], [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list], [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ], [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
This section contains the automagically generated man pages from the OpenSSL git repository, and similar &amp;quot;man&amp;quot; style reference documentation. The man pages are automatically imported from the OpenSSL git repository and local wiki modifications are submitted as patches.&lt;br /&gt;
:* [https://www.openssl.org/docs/manpages.html OpenSSL Manual Pages]&lt;br /&gt;
:* [[API]], [[Libcrypto API]], [[Libssl API]]&lt;br /&gt;
:* [[FIPS mode()]], [[FIPS_mode_set()]]&lt;br /&gt;
&lt;br /&gt;
== Usage and Programming ==&lt;br /&gt;
This section has discussions of practical issues in using OpenSSL&lt;br /&gt;
:* Building from Source&lt;br /&gt;
:: Where to find it, the different versions, how to build and install it.&lt;br /&gt;
:* [[OpenSSL Overview]]&lt;br /&gt;
:* [[Versioning]]&lt;br /&gt;
:* [[Compilation and Installation]]&lt;br /&gt;
:* [[EVP]]&lt;br /&gt;
:: Programming techniques and example code&lt;br /&gt;
:: Use of EVP is preferred for most applications and circumstances&lt;br /&gt;
::* [[EVP Asymmetric Encryption and Decryption of an Envelope]]&lt;br /&gt;
::* [[EVP Authenticated Encryption and Decryption]]&lt;br /&gt;
::* [[EVP Symmetric Encryption and Decryption]]&lt;br /&gt;
::* [[EVP Key and Parameter Generation]]&lt;br /&gt;
::* [[EVP Key Agreement]]&lt;br /&gt;
::* [[EVP Message Digests]]&lt;br /&gt;
::* [[EVP Key Derivation]]&lt;br /&gt;
::* [[EVP Signing and Verifying|EVP Signing and Verifying (including MAC codes)]]&lt;br /&gt;
:* [[STACK API]]&lt;br /&gt;
:* [[List of SSL OP Flags]]&lt;br /&gt;
:* Low Level APIs&lt;br /&gt;
::[[Creating an OpenSSL Engine to use indigenous ECDH ECDSA and HASH Algorithms]]&lt;br /&gt;
:: More specialized non-EVP usage&lt;br /&gt;
::* [[Diffie-Hellman parameters]]&lt;br /&gt;
:* [[FIPS Mode]]&lt;br /&gt;
:* [[Simple TLS Server]]&lt;br /&gt;
&lt;br /&gt;
== Concepts and Theory ==&lt;br /&gt;
Discussions of basic cryptographic theory and concepts&lt;br /&gt;
Discussions of common operational issues&lt;br /&gt;
:* [[Base64]]&lt;br /&gt;
:* [http://wiki.openssl.org/index.php/Category:FIPS_140 FIPS 140-2]&lt;br /&gt;
:* [[Random Numbers]]&lt;br /&gt;
:* [[Diffie Hellman]]&lt;br /&gt;
:* [[Elliptic Curve Diffie Hellman]]&lt;br /&gt;
:* [[Elliptic Curve Cryptography]]&lt;br /&gt;
&lt;br /&gt;
== Security Advisories ==&lt;br /&gt;
:* [https://www.openssl.org/policies/secpolicy.html OpenSSL Security Policy]&lt;br /&gt;
:* [https://www.openssl.org/news/vulnerabilities.html OpenSSL Vulnerabilities List]&lt;br /&gt;
:* [[Security_Advisories|Security Advisories Additional Information]]&lt;br /&gt;
&lt;br /&gt;
== Feedback and Contributions ==&lt;br /&gt;
:* [https://www.openssl.org/news/vulnerabilities.html How to notify us of suspected security vulnerabilities]&lt;br /&gt;
:* [https://www.openssl.org/community/#bugs How to report bugs, other than for suspected vulnerabilities]&lt;br /&gt;
:* [[Contributions|General background on source and documentation contributions - '''must read''']]&lt;br /&gt;
:* Contributing code fixes, other than for suspected vulnerabilities, as well as fixes and other improvements to manual pages:&lt;br /&gt;
::* If you are unsure as to whether a feature will be useful for the general OpenSSL community please discuss it on the [https://www.openssl.org/community/ openssl-users mailing list] first.  Someone may be already working on the same thing or there may be a good reason as to why that feature isn't implemented.&lt;br /&gt;
::* Follow the [[Use of Git#Use_of_Git_with_OpenSSL_source_tree|instructions for accessing source code]] in the appropriate branches. Note that manual pages and the FAQ are maintained with the source code.&lt;br /&gt;
::* Submit a pull request for each separate fix (also documented [[Use of Git#Use_of_Git_with_OpenSSL_source_tree|there]])&lt;br /&gt;
::* Submit a bug report (see second bullet, above) and reference the pull request. Or you can attach the patch to the ticket.&lt;br /&gt;
:* Contributing fixes and other improvements to the web site&lt;br /&gt;
::* Follow the [[Use_of_Git#Use_of_Git_with_the_OpenSSL_web_site|instructions for accessing web site sources]]&lt;br /&gt;
::* Create a patch (also documented [[Use_of_Git#Use_of_Git_with_the_OpenSSL_web_site|there]])&lt;br /&gt;
::* Submit a bug report and add the patch as an attachment&lt;br /&gt;
:* [[Developing For OpenSSL]]&lt;br /&gt;
:* [[KnownPatches|Known patches not part of OpenSSL]]&lt;br /&gt;
:* [[Welcome|Contributing to this wiki]]&lt;br /&gt;
&lt;br /&gt;
== Internals and Development ==&lt;br /&gt;
This section is for internal details of primary interest to OpenSSL maintainers and power users&lt;br /&gt;
:* [[Code reformatting]]&lt;br /&gt;
&lt;br /&gt;
:* [[Internals]]&lt;br /&gt;
:* [[Code Quality]]&lt;br /&gt;
:* [[Static and Dynamic Analysis]]&lt;br /&gt;
:* [[OCB|OCB Licence details]]&lt;br /&gt;
:* [[Defect and Feature Review Process]]&lt;br /&gt;
:* [[Unit Testing]] (includes other automated testing information)&lt;br /&gt;
:* [[How to Integrate a Symmetric Cipher]]&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2651</id>
		<title>TLS1.3</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=TLS1.3&amp;diff=2651"/>
		<updated>2018-04-20T08:09:12Z</updated>

		<summary type="html">&lt;p&gt;Kurt: Import from blog&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenSSL 1.1.1 release includes support for TLSv1.3. The release is binary and API compatible with OpenSSL 1.1.0. In theory, if your application supports OpenSSL 1.1.0, then all you need to do to upgrade is to drop in the new version of OpenSSL and you will automatically start being able to use TLSv1.3. However there are some issues that application developers and deployers need to be aware of.&lt;br /&gt;
&lt;br /&gt;
== Differences with TLS1.2 and below ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is a major rewrite of the specification. There was some debate as to whether it should really be called TLSv2.0 - but TLSv1.3 it is. There are major changes and some things work very differently. A brief, incomplete, summary of some things that you are likely to notice follows:&lt;br /&gt;
&lt;br /&gt;
* There are new ciphersuites that only work in TLSv1.3. The old ciphersuites cannot be used for TLSv1.3 connections.&lt;br /&gt;
* The new ciphersuites are defined differently and do not specify the certificate type (e.g. RSA, DSA, ECDSA) or the key exchange mechanism (e.g. DHE or ECHDE). This has implications for ciphersuite configuration.&lt;br /&gt;
* Clients provide a “key_share” in the ClientHello. This has consequences for “group” configuration.&lt;br /&gt;
* Sessions are not established until after the main handshake has been completed. There may be a gap between the end of the handshake and the establishment of a session (or, in theory, a session may not be established at all). This could have impacts on session resumption code.&lt;br /&gt;
* Renegotiation is not possible in a TLSv1.3 connection&lt;br /&gt;
* More of the handshake is now encrypted.&lt;br /&gt;
* More types of messages can now have extensions (this has an impact on the custom extension APIs and Certificate Transparency)&lt;br /&gt;
* DSA certificates are no longer allowed in TLSv1.3 connections&lt;br /&gt;
&lt;br /&gt;
Note that at this stage only TLSv1.3 is supported. DTLSv1.3 is still in the early days of specification and there is no OpenSSL support for it at this time.&lt;br /&gt;
&lt;br /&gt;
== Current status of the TLSv1.3 standard ==&lt;br /&gt;
&lt;br /&gt;
As of the time of writing TLSv1.3 is still in draft. Periodically a new version of the draft standard is published by the TLS Working Group. Implementations of the draft are required to identify the specific draft version that they are using. This means that implementations based on different draft versions do not interoperate with each other.&lt;br /&gt;
&lt;br /&gt;
OpenSSL 1.1.1 will not be released until (at least) TLSv1.3 is finalised. In the meantime the OpenSSL git master branch contains our development TLSv1.3 code which can be used for testing purposes (i.e. it is not for production use). You can check which draft TLSv1.3 version is implemented in any particular OpenSSL checkout by examining the value of the TLS1_3_VERSION_DRAFT_TXT macro in the tls1.h header file. This macro will be removed when the final version of the standard is released.&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 is enabled by default in the latest development versions (there is no need to explicitly enable it). To disable it at compile time you must use the “no-tls1_3” option to “config” or “Configure”.&lt;br /&gt;
&lt;br /&gt;
Currently OpenSSL has implemented the “draft-26” version of TLSv1.3. Other applications that support TLSv1.3 may still be using older draft versions. This is a common source of interoperability problems. If two peers supporting different TLSv1.3 draft versions attempt to communicate then they will fall back to TLSv1.2.&lt;br /&gt;
&lt;br /&gt;
== Ciphersuites ==&lt;br /&gt;
&lt;br /&gt;
OpenSSL has implemented support for five TLSv1.3 ciphersuites as follows:&lt;br /&gt;
&lt;br /&gt;
* TLS13-AES-256-GCM-SHA384&lt;br /&gt;
* TLS13-CHACHA20-POLY1305-SHA256&lt;br /&gt;
* TLS13-AES-128-GCM-SHA256&lt;br /&gt;
* TLS13-AES-128-CCM-8-SHA256&lt;br /&gt;
* TLS13-AES-128-CCM-SHA256&lt;br /&gt;
&lt;br /&gt;
Of these the first three are in the DEFAULT ciphersuite group. This means that if you have no explicit ciphersuite configuration then you will automatically use those three and will be able to negotiate TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
All the TLSv1.3 ciphersuites also appear in the HIGH ciphersuite alias. The CHACHA20, AES, AES128, AES256, AESGCM, AESCCM and AESCCM8 ciphersuite aliases include a subset of these ciphersuites as you would expect based on their names. Key exchange and authentication properties were part of the ciphersuite definition in TLSv1.2 and below. This is no longer the case in TLSv1.3 so ciphersuite aliases such as ECDHE, ECDSA, RSA and other similar aliases do not contain any TLSv1.3 ciphersuites.&lt;br /&gt;
&lt;br /&gt;
If you explicitly configure your ciphersuites then care should be taken to ensure that you are not inadvertently excluding all TLSv1.3 compatible ciphersuites. If a client has TLSv1.3 enabled but no TLSv1.3 ciphersuites configured then it will immediately fail (even if the server does not support TLSv1.3) with an error message like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
140399519134144:error:141A90B5:SSL routines:ssl_cipher_list_to_bytes:no ciphers available:ssl/statem/statem_clnt.c:3715:No ciphers enabled for max supported SSL/TLS version&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly if a server has TLSv1.3 enabled but no TLSv1.3 ciphersuites it will also immediately fail, even if the client does not support TLSv1.3, with an error message like this:&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
140640328024512:error:141FC0B5:SSL routines:tls_setup_handshake:no ciphers available:ssl/statem/statem_lib.c:120:No ciphers enabled for max supported SSL/TLS version&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, setting a ciphersuite selection string of ECDHE:!COMPLEMENTOFDEFAULT will work in OpenSSL 1.1.0 and will only select those ciphersuites that are in DEFAULT and also use ECDHE for key exchange. However no TLSv1.3 ciphersuites are in the ECDHE group so this ciphersuite configuration will fail in OpenSSL 1.1.1 if TLSv1.3 is enabled.&lt;br /&gt;
&lt;br /&gt;
You may want to explicitly list the TLSv1.3 ciphersuites you want to use to avoid problems. For example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:ECDHE:!COMPLEMENTOFDEFAULT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can test which ciphersuites are included in a given ciphersuite selection string using the openssl ciphers -s -v command:&lt;br /&gt;
&lt;br /&gt;
$ openssl ciphers -s -v &amp;quot;ECDHE:!COMPLEMENTOFDEFAULT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ensure that at least one ciphersuite supports TLSv1.3&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the client selects a “group” that it will use for key exchange. At the time of writing, OpenSSL only supports ECDHE groups for this. The client then sends “key_share” information to the server for its selected group in the ClientHello.&lt;br /&gt;
&lt;br /&gt;
The list of supported groups is configurable. It is possible for a client to select a group that the server does not support. In this case the server requests that the client sends a new key_share that it does support. While this means a connection will still be established (assuming a mutually supported group exists), it does introduce an extra server round trip - so this has implications for performance. In the ideal scenario the client will select a group that the server supports in the first instance.&lt;br /&gt;
&lt;br /&gt;
In practice most clients will use X25519 or P-256 for their initial key_share. For maximum performance it is recommended that servers are configured to support at least those two groups and clients use one of those two for its initial key_share. This is the default case (OpenSSL clients will use X25519).&lt;br /&gt;
&lt;br /&gt;
The group configuration also controls the allowed groups in TLSv1.2 and below. If applications have previously configured their groups in OpenSSL 1.1.0 then you should review that configuration to ensure that it still makes sense for TLSv1.3. The first named (i.e. most preferred group) will be the one used by an OpenSSL client in its intial key_share.&lt;br /&gt;
&lt;br /&gt;
Applications can configure the group list by using SSL_CTX_set1_groups() or a similar function (see here for further details). Alternatively, if applications use SSL_CONF style configuration files then this can be configured using the Groups or Curves command (see here).&lt;br /&gt;
&lt;br /&gt;
== Sessions ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below a session is established as part of the handshake. This session can then be used in a subsequent connection to achieve an abbreviated handshake. Applications might typically obtain a handle on the session after a handshake has completed using the SSL_get1_session() function (or similar). See here for further details.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 sessions are not established until after the main handshake has completed. The server sends a separate post-handshake message to the client containing the session details. Typically this will happen soon after the handshake has completed, but it could be sometime later (or not at all).&lt;br /&gt;
&lt;br /&gt;
The specification recommends that applications only use a session once (although this is not enforced). For this reason some servers send multiple session messages to a client. To enforce the “use once” recommendation applications could use SSL_CTX_remove_session() to mark a session as non-resumable (and remove it from the cache) once it has been used.&lt;br /&gt;
&lt;br /&gt;
The old SSL_get1_session() and similar APIs may not operate as expected for client applications written for TLSv1.2 and below. Specifically if a client application calls SSL_get1_session() before the server message containing session details has been received then an SSL_SESSION object will still be returned, but any attempt to resume with it will not succeed and a full handshake will occur instead. In the case where multiple sessions have been sent by the server then only the last session will be returned by SSL_get1_session().&lt;br /&gt;
&lt;br /&gt;
Client application developers should consider using the SSL_CTX_sess_set_new_cb() API instead (see here). This provides a callback mechanism which gets invoked every time a new session is established. This can get invoked multiple times for a single connection if a server sends multiple session messages.&lt;br /&gt;
&lt;br /&gt;
Note that SSL_CTX_sess_set_new_cb() was also available in OpenSSL 1.1.0. Applications that already used that API will still work, but they may find that the callback is invoked at unexpected times, i.e. post-handshake.&lt;br /&gt;
&lt;br /&gt;
An OpenSSL server will immediately attempt to send session details to a client after the main handshake has completed. To server applications this post-handshake stage will appear to be part of the main handshake, so calls to SSL_get1_session() should continue to work as before.&lt;br /&gt;
&lt;br /&gt;
== Custom Extensions and Certificate Transparency ==&lt;br /&gt;
&lt;br /&gt;
In TLSv1.2 and below the initial ClientHello and ServerHello messages can contain “extensions”. This allows the base specifications to be extended with additional features and capabilities that may not be applicable in all scenarios or could not be foreseen at the time that the base specifications were written. OpenSSL provides support for a number of “built-in” extensions.&lt;br /&gt;
&lt;br /&gt;
Additionally the custom extensions API provides some basic capabilities for application developers to add support for new extensions that are not built-in to OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Built on top of the custom extensions API is the “serverinfo” API. This provides an even more basic interface that can be configured at run time. One use case for this is Certificate Transparency. OpenSSL provides built-in support for the client side of Certificate Transparency but there is no built-in server side support. However this can easily be achieved using “serverinfo” files. A serverinfo file containing the Certificate Transparency information can be configured within OpenSSL and it will then be sent back to the client as appropriate.&lt;br /&gt;
&lt;br /&gt;
In TLSv1.3 the use of extensions is expanded significantly and there are many more messages that can include them. Additionally some extensions that were applicable to TLSv1.2 and below are no longer applicable in TLSv1.3 and some extensions are moved from the ServerHello message to the EncryptedExtensions message. The old custom extensions API does not have the ability to specify which messages the extensions should be associated with. For that reason a new custom extensions API was required.&lt;br /&gt;
&lt;br /&gt;
The old API will still work, but the custom extensions will only be added where TLSv1.2 or below is negotiated. To add custom extensions that work for all TLS versions application developers will need to update their applications to the new API (see here for details).&lt;br /&gt;
&lt;br /&gt;
The “serverinfo” data format has also been updated to include additional information about which messages the extensions are relevant to. Applications using “serverinfo” files may need to update to the “version 2” file format to be able to operate in TLSv1.3 (see here and here for details).&lt;br /&gt;
&lt;br /&gt;
== Renegotiation ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 does not have renegotiation so calls to SSL_renegotiate() or SSL_renegotiate_abbreviated() will immediately fail if invoked on a connection that has negotiated TLSv1.3.&lt;br /&gt;
&lt;br /&gt;
A common use case for renegotiation is to update the connection keys. The function SSL_key_update() can be used for this purpose in TLSv1.3 (see here for further details).&lt;br /&gt;
&lt;br /&gt;
Another use case is to request a certificate from the client. This can be achieved by using the SSL_verify_client_post_handshake() function in TLSv1.3 (see here for further details).&lt;br /&gt;
&lt;br /&gt;
== DSA certificates ==&lt;br /&gt;
&lt;br /&gt;
DSA certificates are no longer allowed in TLSv1.3. If your server application is using a DSA certificate then TLSv1.3 connections will fail with an error message similar to the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
140348850206144:error:14201076:SSL routines:tls_choose_sigalg:no suitable signature algorithm:ssl/t1_lib.c:2308:&lt;br /&gt;
&lt;br /&gt;
Please use an ECDSA or RSA certificate instead.&lt;br /&gt;
&lt;br /&gt;
== Middlebox Compatibility Mode ==&lt;br /&gt;
&lt;br /&gt;
During development of the TLSv1.3 standard it became apparent that in some cases, even if a client and server both support TLSv1.3, connections could sometimes still fail. This is because middleboxes on the network between the two peers do not understand the new protocol and prevent the connection from taking place. In order to work around this problem the TLSv1.3 specification introduced a “middlebox compatibility” mode. This made a few optional changes to the protocol to make it appear more like TLSv1.2 so that middleboxes would let it through. Largely these changes are superficial in nature but do include sending some small but unneccessary messages. OpenSSL has middlebox compatibility mode on by default, so most users should not need to worry about this. However applications may choose to switch it off by calling the function SSL_CTX_clear_options() and passing SSL_OP_ENABLE_MIDDLEBOX_COMPAT as an argument (see here for further details).&lt;br /&gt;
&lt;br /&gt;
If the remote peer is not using middlebox compatibility mode and there are problematic middleboxes on the network path then this could cause spurious connection failures.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
TLSv1.3 represents a significant step forward and has some exciting new features but there are some hazards for the unwary when upgrading. Mostly these issues have relatively straight forward solutions. Application developers should review their code and consider whether anything should be updated in order to work more effectively with TLSv1.3. Similarly application deployers should review their configuration.&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_1.1.0_Changes&amp;diff=2492</id>
		<title>OpenSSL 1.1.0 Changes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_1.1.0_Changes&amp;diff=2492"/>
		<updated>2016-11-04T15:48:25Z</updated>

		<summary type="html">&lt;p&gt;Kurt: /* Adding forward-compatible code to older versions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a parent page for discussion about API changes being done for OpenSSL version 1.1&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to make most data structures opaque to applications.  This provides us with a number of benefits:&lt;br /&gt;
* We can add fields without breaking [[Binary_Compatibility|binary compatibility]]&lt;br /&gt;
* Applications are more robust and can be more assured about correctness&lt;br /&gt;
* It helps us determine which (new) accessors and settors, for example, are needed&lt;br /&gt;
&lt;br /&gt;
Please add sub-pages to discuss particular parts of the library as work progresses.&lt;br /&gt;
&lt;br /&gt;
== Major Changes so far ==&lt;br /&gt;
&lt;br /&gt;
* All structures in libssl public header files have been removed so that they are &amp;quot;opaque&amp;quot; to library users. You should use the provided accessor functions instead&lt;br /&gt;
* The old DES API has been removed&lt;br /&gt;
* bn, a sub library in libcrypto, has been made opaque&lt;br /&gt;
* Access to deprecated functions/macros has been removed by default. To enable access you must do two things. 1) Build OpenSSL with deprecation support (pass &amp;quot;enable-deprecated&amp;quot; as an argument to config) 2) Applications must define &amp;quot;OPENSSL_USE_DEPRECATED&amp;quot; before including OpenSSL header files&lt;br /&gt;
* HMAC_Init and HMAC_cleanup were previously stated in the docs and header files as being deprecated - but were not flagged in previous versions with OPENSSL_NO_DEPRECATED. This has been corrected in 1.1.0. Access to these functions/macros will be off by default in 1.1.0 as per the note above about deprecation.&lt;br /&gt;
&lt;br /&gt;
== OPENSSL_API_COMPAT ==&lt;br /&gt;
&lt;br /&gt;
Various functions get deprecated as other interfaces get added, but are still available in a default build.&lt;br /&gt;
The include files support setting the OPENSSL_API_COMPAT define that will hide functions that are deprecated in the selected version.&lt;br /&gt;
To select the 1.1.0 version use -DOPENSSL_API_COMPAT=0x10100000L.&lt;br /&gt;
&lt;br /&gt;
== Backward compatibility ==&lt;br /&gt;
&lt;br /&gt;
Since some structures have become opaque you can't directly access the member any more.  You might need to create backward compatible macros or functions if you still want to support older versions of OpenSSL.  A suggested way of doing that is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #if OPENSSL_VERSION_NUMBER &amp;lt; 0x10100000L&lt;br /&gt;
 #define OBJ_get0_data(o) ((o)-&amp;gt;data)&lt;br /&gt;
 #define OBJ_length(o) ((o)-&amp;gt;length)&lt;br /&gt;
 #endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding forward-compatible code to older versions ==&lt;br /&gt;
&lt;br /&gt;
Application code now has to use pointers, and cannot allocate objects directly on the stack. For instance if the old code did:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    BN_CTX ctx;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have to do:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    BN_CTX *ctx;&lt;br /&gt;
&lt;br /&gt;
    ctx = BN_CTX_new();&lt;br /&gt;
    [...]&lt;br /&gt;
    BN_CTX_free(ctx);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to access rsa-&amp;gt;n you now have to do something like:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    const BIGNUM *n;&lt;br /&gt;
&lt;br /&gt;
    RSA_get0_key(rsa, &amp;amp;n, NULL, NULL);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are new functions available for to get and set such variables that are not available in older versions. The suggested way to solve this is add your own copy of the new functions based on the one in OpenSSL 1.1.0.  Here is an overview of most of them and how they could look like:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #if OPENSSL_VERSION_NUMBER &amp;lt; 0x10100000L&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;openssl/engine.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 static void *OPENSSL_zalloc(size_t num)&lt;br /&gt;
 {&lt;br /&gt;
    void *ret = OPENSSL_malloc(num);&lt;br /&gt;
&lt;br /&gt;
    if (ret != NULL)&lt;br /&gt;
        memset(ret, 0, num);&lt;br /&gt;
    return ret;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)&lt;br /&gt;
 {&lt;br /&gt;
    /* If the fields n and e in r are NULL, the corresponding input&lt;br /&gt;
     * parameters MUST be non-NULL for n and e.  d may be&lt;br /&gt;
     * left NULL (in case only the public key is used).&lt;br /&gt;
     */&lt;br /&gt;
    if ((r-&amp;gt;n == NULL &amp;amp;&amp;amp; n == NULL)&lt;br /&gt;
        || (r-&amp;gt;e == NULL &amp;amp;&amp;amp; e == NULL))&lt;br /&gt;
        return 0;&lt;br /&gt;
&lt;br /&gt;
    if (n != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;n);&lt;br /&gt;
        r-&amp;gt;n = n;&lt;br /&gt;
    }&lt;br /&gt;
    if (e != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;e);&lt;br /&gt;
        r-&amp;gt;e = e;&lt;br /&gt;
    }&lt;br /&gt;
    if (d != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;d);&lt;br /&gt;
        r-&amp;gt;d = d;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)&lt;br /&gt;
 {&lt;br /&gt;
    /* If the fields p and q in r are NULL, the corresponding input&lt;br /&gt;
     * parameters MUST be non-NULL.&lt;br /&gt;
     */&lt;br /&gt;
    if ((r-&amp;gt;p == NULL &amp;amp;&amp;amp; p == NULL)&lt;br /&gt;
        || (r-&amp;gt;q == NULL &amp;amp;&amp;amp; q == NULL))&lt;br /&gt;
        return 0;&lt;br /&gt;
&lt;br /&gt;
    if (p != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;p);&lt;br /&gt;
        r-&amp;gt;p = p;&lt;br /&gt;
    }&lt;br /&gt;
    if (q != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;q);&lt;br /&gt;
        r-&amp;gt;q = q;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp)&lt;br /&gt;
 {&lt;br /&gt;
    /* If the fields dmp1, dmq1 and iqmp in r are NULL, the corresponding input&lt;br /&gt;
     * parameters MUST be non-NULL.&lt;br /&gt;
     */&lt;br /&gt;
    if ((r-&amp;gt;dmp1 == NULL &amp;amp;&amp;amp; dmp1 == NULL)&lt;br /&gt;
        || (r-&amp;gt;dmq1 == NULL &amp;amp;&amp;amp; dmq1 == NULL)&lt;br /&gt;
        || (r-&amp;gt;iqmp == NULL &amp;amp;&amp;amp; iqmp == NULL))&lt;br /&gt;
        return 0;&lt;br /&gt;
&lt;br /&gt;
    if (dmp1 != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;dmp1);&lt;br /&gt;
        r-&amp;gt;dmp1 = dmp1;&lt;br /&gt;
    }&lt;br /&gt;
    if (dmq1 != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;dmq1);&lt;br /&gt;
        r-&amp;gt;dmq1 = dmq1;&lt;br /&gt;
    }&lt;br /&gt;
    if (iqmp != NULL) {&lt;br /&gt;
        BN_free(r-&amp;gt;iqmp);&lt;br /&gt;
        r-&amp;gt;iqmp = iqmp;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void RSA_get0_key(const RSA *r,&lt;br /&gt;
                  const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)&lt;br /&gt;
 {&lt;br /&gt;
    if (n != NULL)&lt;br /&gt;
        *n = r-&amp;gt;n;&lt;br /&gt;
    if (e != NULL)&lt;br /&gt;
        *e = r-&amp;gt;e;&lt;br /&gt;
    if (d != NULL)&lt;br /&gt;
        *d = r-&amp;gt;d;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q)&lt;br /&gt;
 {&lt;br /&gt;
    if (p != NULL)&lt;br /&gt;
        *p = r-&amp;gt;p;&lt;br /&gt;
    if (q != NULL)&lt;br /&gt;
        *q = r-&amp;gt;q;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void RSA_get0_crt_params(const RSA *r,&lt;br /&gt;
                         const BIGNUM **dmp1, const BIGNUM **dmq1,&lt;br /&gt;
                         const BIGNUM **iqmp)&lt;br /&gt;
 {&lt;br /&gt;
    if (dmp1 != NULL)&lt;br /&gt;
        *dmp1 = r-&amp;gt;dmp1;&lt;br /&gt;
    if (dmq1 != NULL)&lt;br /&gt;
        *dmq1 = r-&amp;gt;dmq1;&lt;br /&gt;
    if (iqmp != NULL)&lt;br /&gt;
        *iqmp = r-&amp;gt;iqmp;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void DSA_get0_pqg(const DSA *d,&lt;br /&gt;
                  const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)&lt;br /&gt;
 {&lt;br /&gt;
    if (p != NULL)&lt;br /&gt;
        *p = d-&amp;gt;p;&lt;br /&gt;
    if (q != NULL)&lt;br /&gt;
        *q = d-&amp;gt;q;&lt;br /&gt;
    if (g != NULL)&lt;br /&gt;
        *g = d-&amp;gt;g;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)&lt;br /&gt;
 {&lt;br /&gt;
    /* If the fields p, q and g in d are NULL, the corresponding input&lt;br /&gt;
     * parameters MUST be non-NULL.&lt;br /&gt;
     */&lt;br /&gt;
    if ((d-&amp;gt;p == NULL &amp;amp;&amp;amp; p == NULL)&lt;br /&gt;
        || (d-&amp;gt;q == NULL &amp;amp;&amp;amp; q == NULL)&lt;br /&gt;
        || (d-&amp;gt;g == NULL &amp;amp;&amp;amp; g == NULL))&lt;br /&gt;
        return 0;&lt;br /&gt;
&lt;br /&gt;
    if (p != NULL) {&lt;br /&gt;
        BN_free(d-&amp;gt;p);&lt;br /&gt;
        d-&amp;gt;p = p;&lt;br /&gt;
    }&lt;br /&gt;
    if (q != NULL) {&lt;br /&gt;
        BN_free(d-&amp;gt;q);&lt;br /&gt;
        d-&amp;gt;q = q;&lt;br /&gt;
    }&lt;br /&gt;
    if (g != NULL) {&lt;br /&gt;
        BN_free(d-&amp;gt;g);&lt;br /&gt;
        d-&amp;gt;g = g;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void DSA_get0_key(const DSA *d,&lt;br /&gt;
                  const BIGNUM **pub_key, const BIGNUM **priv_key)&lt;br /&gt;
 {&lt;br /&gt;
    if (pub_key != NULL)&lt;br /&gt;
        *pub_key = d-&amp;gt;pub_key;&lt;br /&gt;
    if (priv_key != NULL)&lt;br /&gt;
        *priv_key = d-&amp;gt;priv_key;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)&lt;br /&gt;
 {&lt;br /&gt;
    /* If the field pub_key in d is NULL, the corresponding input&lt;br /&gt;
     * parameters MUST be non-NULL.  The priv_key field may&lt;br /&gt;
     * be left NULL.&lt;br /&gt;
     */&lt;br /&gt;
    if (d-&amp;gt;pub_key == NULL &amp;amp;&amp;amp; pub_key == NULL)&lt;br /&gt;
        return 0;&lt;br /&gt;
&lt;br /&gt;
    if (pub_key != NULL) {&lt;br /&gt;
        BN_free(d-&amp;gt;pub_key);&lt;br /&gt;
        d-&amp;gt;pub_key = pub_key;&lt;br /&gt;
    }&lt;br /&gt;
    if (priv_key != NULL) {&lt;br /&gt;
        BN_free(d-&amp;gt;priv_key);&lt;br /&gt;
        d-&amp;gt;priv_key = priv_key;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)&lt;br /&gt;
 {&lt;br /&gt;
    if (pr != NULL)&lt;br /&gt;
        *pr = sig-&amp;gt;r;&lt;br /&gt;
    if (ps != NULL)&lt;br /&gt;
        *ps = sig-&amp;gt;s;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s)&lt;br /&gt;
 {&lt;br /&gt;
    if (r == NULL || s == NULL)&lt;br /&gt;
        return 0;&lt;br /&gt;
    BN_clear_free(sig-&amp;gt;r);&lt;br /&gt;
    BN_clear_free(sig-&amp;gt;s);&lt;br /&gt;
    sig-&amp;gt;r = r;&lt;br /&gt;
    sig-&amp;gt;s = s;&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)&lt;br /&gt;
 {&lt;br /&gt;
    if (pr != NULL)&lt;br /&gt;
        *pr = sig-&amp;gt;r;&lt;br /&gt;
    if (ps != NULL)&lt;br /&gt;
        *ps = sig-&amp;gt;s;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)&lt;br /&gt;
 {&lt;br /&gt;
    if (r == NULL || s == NULL)&lt;br /&gt;
        return 0;&lt;br /&gt;
    BN_clear_free(sig-&amp;gt;r);&lt;br /&gt;
    BN_clear_free(sig-&amp;gt;s);&lt;br /&gt;
    sig-&amp;gt;r = r;&lt;br /&gt;
    sig-&amp;gt;s = s;&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void DH_get0_pqg(const DH *dh,&lt;br /&gt;
                 const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)&lt;br /&gt;
 {&lt;br /&gt;
    if (p != NULL)&lt;br /&gt;
        *p = dh-&amp;gt;p;&lt;br /&gt;
    if (q != NULL)&lt;br /&gt;
        *q = dh-&amp;gt;q;&lt;br /&gt;
    if (g != NULL)&lt;br /&gt;
        *g = dh-&amp;gt;g;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)&lt;br /&gt;
 {&lt;br /&gt;
    /* If the fields p and g in d are NULL, the corresponding input&lt;br /&gt;
     * parameters MUST be non-NULL.  q may remain NULL.&lt;br /&gt;
     */&lt;br /&gt;
    if ((dh-&amp;gt;p == NULL &amp;amp;&amp;amp; p == NULL)&lt;br /&gt;
        || (dh-&amp;gt;g == NULL &amp;amp;&amp;amp; g == NULL))&lt;br /&gt;
        return 0;&lt;br /&gt;
&lt;br /&gt;
    if (p != NULL) {&lt;br /&gt;
        BN_free(dh-&amp;gt;p);&lt;br /&gt;
        dh-&amp;gt;p = p;&lt;br /&gt;
    }&lt;br /&gt;
    if (q != NULL) {&lt;br /&gt;
        BN_free(dh-&amp;gt;q);&lt;br /&gt;
        dh-&amp;gt;q = q;&lt;br /&gt;
    }&lt;br /&gt;
    if (g != NULL) {&lt;br /&gt;
        BN_free(dh-&amp;gt;g);&lt;br /&gt;
        dh-&amp;gt;g = g;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (q != NULL) {&lt;br /&gt;
        dh-&amp;gt;length = BN_num_bits(q);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)&lt;br /&gt;
 {&lt;br /&gt;
    if (pub_key != NULL)&lt;br /&gt;
        *pub_key = dh-&amp;gt;pub_key;&lt;br /&gt;
    if (priv_key != NULL)&lt;br /&gt;
        *priv_key = dh-&amp;gt;priv_key;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)&lt;br /&gt;
 {&lt;br /&gt;
    /* If the field pub_key in dh is NULL, the corresponding input&lt;br /&gt;
     * parameters MUST be non-NULL.  The priv_key field may&lt;br /&gt;
     * be left NULL.&lt;br /&gt;
     */&lt;br /&gt;
    if (dh-&amp;gt;pub_key == NULL &amp;amp;&amp;amp; pub_key == NULL)&lt;br /&gt;
        return 0;&lt;br /&gt;
&lt;br /&gt;
    if (pub_key != NULL) {&lt;br /&gt;
        BN_free(dh-&amp;gt;pub_key);&lt;br /&gt;
        dh-&amp;gt;pub_key = pub_key;&lt;br /&gt;
    }&lt;br /&gt;
    if (priv_key != NULL) {&lt;br /&gt;
        BN_free(dh-&amp;gt;priv_key);&lt;br /&gt;
        dh-&amp;gt;priv_key = priv_key;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int DH_set_length(DH *dh, long length)&lt;br /&gt;
 {&lt;br /&gt;
    dh-&amp;gt;length = length;&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx)&lt;br /&gt;
 {&lt;br /&gt;
    return ctx-&amp;gt;iv;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx)&lt;br /&gt;
 {&lt;br /&gt;
    return ctx-&amp;gt;iv;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 EVP_MD_CTX *EVP_MD_CTX_new(void)&lt;br /&gt;
 {&lt;br /&gt;
    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void EVP_MD_CTX_free(EVP_MD_CTX *ctx)&lt;br /&gt;
 {&lt;br /&gt;
    EVP_MD_CTX_cleanup(ctx);&lt;br /&gt;
    OPENSSL_free(ctx);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth)&lt;br /&gt;
 {&lt;br /&gt;
    RSA_METHOD *ret;&lt;br /&gt;
&lt;br /&gt;
    ret = OPENSSL_malloc(sizeof(RSA_METHOD));&lt;br /&gt;
&lt;br /&gt;
    if (ret != NULL) {&lt;br /&gt;
        memcpy(ret, meth, sizeof(*meth));&lt;br /&gt;
        ret-&amp;gt;name = OPENSSL_strdup(meth-&amp;gt;name);&lt;br /&gt;
        if (ret-&amp;gt;name == NULL) {&lt;br /&gt;
            OPENSSL_free(ret);&lt;br /&gt;
            return NULL;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return ret;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_meth_set1_name(RSA_METHOD *meth, const char *name)&lt;br /&gt;
 {&lt;br /&gt;
    char *tmpname;&lt;br /&gt;
&lt;br /&gt;
    tmpname = OPENSSL_strdup(name);&lt;br /&gt;
    if (tmpname == NULL) {&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    OPENSSL_free((char *)meth-&amp;gt;name);&lt;br /&gt;
    meth-&amp;gt;name = tmpname;&lt;br /&gt;
&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_meth_set_priv_enc(RSA_METHOD *meth,&lt;br /&gt;
                          int (*priv_enc) (int flen, const unsigned char *from,&lt;br /&gt;
                                           unsigned char *to, RSA *rsa,&lt;br /&gt;
                                           int padding))&lt;br /&gt;
 {&lt;br /&gt;
    meth-&amp;gt;rsa_priv_enc = priv_enc;&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_meth_set_priv_dec(RSA_METHOD *meth,&lt;br /&gt;
                          int (*priv_dec) (int flen, const unsigned char *from,&lt;br /&gt;
                                           unsigned char *to, RSA *rsa,&lt;br /&gt;
                                           int padding))&lt;br /&gt;
 {&lt;br /&gt;
    meth-&amp;gt;rsa_priv_dec = priv_dec;&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa))&lt;br /&gt;
 {&lt;br /&gt;
    meth-&amp;gt;finish = finish;&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void RSA_meth_free(RSA_METHOD *meth)&lt;br /&gt;
 {&lt;br /&gt;
    if (meth != NULL) {&lt;br /&gt;
        OPENSSL_free((char *)meth-&amp;gt;name);&lt;br /&gt;
        OPENSSL_free(meth);&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 int RSA_bits(const RSA *r)&lt;br /&gt;
 {&lt;br /&gt;
    return (BN_num_bits(r-&amp;gt;n));&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)&lt;br /&gt;
 {&lt;br /&gt;
    if (pkey-&amp;gt;type != EVP_PKEY_RSA) {&lt;br /&gt;
        return NULL;&lt;br /&gt;
    }&lt;br /&gt;
    return pkey-&amp;gt;pkey.rsa;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HMAC_CTX *HMAC_CTX_new(void)&lt;br /&gt;
 {&lt;br /&gt;
    HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));&lt;br /&gt;
    if (ctx != NULL) {&lt;br /&gt;
        if (!HMAC_CTX_reset(ctx)) {&lt;br /&gt;
            HMAC_CTX_free(ctx);&lt;br /&gt;
            return NULL;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return ctx;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void HMAC_CTX_free(HMAC_CTX *ctx)&lt;br /&gt;
 {&lt;br /&gt;
    if (ctx != NULL) {&lt;br /&gt;
        hmac_ctx_cleanup(ctx);&lt;br /&gt;
        EVP_MD_CTX_free(ctx-&amp;gt;i_ctx);&lt;br /&gt;
        EVP_MD_CTX_free(ctx-&amp;gt;o_ctx);&lt;br /&gt;
        EVP_MD_CTX_free(ctx-&amp;gt;md_ctx);&lt;br /&gt;
        OPENSSL_free(ctx);&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Qt ==&lt;br /&gt;
&lt;br /&gt;
Here's what's broken in the dev branch of Qt when building openssl master as of 6 Feb 2015.&lt;br /&gt;
&lt;br /&gt;
* DH - we were directly accessing p and q to set the DH params to primes embedded in Qt. We can probably replace this with SSL_CTX_set_dh_auto(ctx, 1). Another option suggested by Steve Henson is to save the DHparams we're using at the moment then use d2i_DHparams to load them in. This is compatible with openssl versions that don't have the dh_auto option.&lt;br /&gt;
&lt;br /&gt;
* ctx-&amp;gt;cert_store - we were directly accessing the cert_store field of SSL_CTX. We can probably replace this with X509_STORE *SSL_CTX_get_cert_store(SSL_CTX *ctx) [Fixed in dev]&lt;br /&gt;
&lt;br /&gt;
* session-&amp;gt;tlsext_tick_lifetime_hint - we were directly accessing the lifetime hint of the session. [A new API to access this field has been added]&lt;br /&gt;
&lt;br /&gt;
* cipher-&amp;gt;valid - we were directly accessing the valid field of SSL_CIPHER. No replacement found. [This turned out not to be needed and so will be removed].&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Curl ==&lt;br /&gt;
&lt;br /&gt;
* SSL_SESSION-&amp;gt;ssl_version. Replaced with SSL_version(SSL *)&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in wget ==&lt;br /&gt;
&lt;br /&gt;
* SSL-&amp;gt;state. Replaced with SSL_state(SSL *)&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Apache Traffic Manager ==&lt;br /&gt;
&lt;br /&gt;
* Setting SSL-&amp;gt;rbio without setting SSL-&amp;gt;wbio. New function introduction in 1.1.0 to handle this: SSL_set_rbio()&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in OpenConnect ==&lt;br /&gt;
&lt;br /&gt;
In order to simulate &amp;quot;resume&amp;quot; of a DTLS session which never really existed but which was actually negotiated over the VPN control connection, [http://git.infradead.org/users/dwmw2/openconnect.git/blob/fa5cea08:/dtls.c#l147 this code] in the [http://www.infradead.org/openconnect/ OpenConnect VPN client] needs to set the following fields in a new &amp;lt;tt&amp;gt;SSL_SESSION&amp;lt;/tt&amp;gt;:&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;ssl_version&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;cipher{,_id}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;master_key{,_length}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;session_id{,_length}&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was fixed with [http://git.infradead.org/users/dwmw2/openconnect.git/commitdiff/5abb133f this OpenConnect commit] which makes it create the ASN.1 representation of the session and import it with &amp;lt;tt&amp;gt;d2i_SSL_SESSION()&amp;lt;/tt&amp;gt;. This is done conditionally in the above patch because it depends on the [http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=af674d4e20a82c2a98767b837072d7093c70b1cf fix in openssl HEAD] for &amp;lt;tt&amp;gt;d2i_SSL_SESSION()&amp;lt;/tt&amp;gt; to make it cope with &amp;lt;tt&amp;gt;DTLS1_BAD_VER&amp;lt;/tt&amp;gt; &amp;lt;i&amp;gt;([http://rt.openssl.org/Ticket/Display.html?id=3704 RT#3704])&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other simpler things which broke:&lt;br /&gt;
* &amp;lt;tt&amp;gt;SSL_CIPHER-&amp;gt;id&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;SSL_CIPHER_get_id()&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SSL_CTX-&amp;gt;extra_certs&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;SSL_CTX_get_extra_chain_certs_only()&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in TianoCore/EDKII ==&lt;br /&gt;
&lt;br /&gt;
EDKII is the reference implementation of UEFI firmware.&lt;br /&gt;
&lt;br /&gt;
* Various implicit inclusions of &amp;lt;tt&amp;gt;&amp;amp;lt;openssl/bn.h&amp;amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;amp;lt;openssl/rsa.h&amp;amp;gt;&amp;lt;/tt&amp;gt; needed to be made explicit. ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/8d7d32c1 (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;X509_NAME-&amp;gt;bytes-&amp;gt;{data,length}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;i2d_X509_NAME()&amp;lt;/tt&amp;gt; ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/e192c51b (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;X509_ATTRIBUTE-&amp;gt;{object,value}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;X509_ATTRIBUTE_get0_object()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;X509_ATTRIBUTE_get0_type()&amp;lt;/tt&amp;gt; ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/1bd8ee96 (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;ASN1_OBJECT-&amp;gt;{length,data}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;OBJ_get0_data()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OBJ_length()&amp;lt;/tt&amp;gt;. With backward-compatibility &amp;lt;tt&amp;gt;#define&amp;lt;/tt&amp;gt; of same. ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/6a7a36edc (commit)]''&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_1.1.0_Changes&amp;diff=2404</id>
		<title>OpenSSL 1.1.0 Changes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_1.1.0_Changes&amp;diff=2404"/>
		<updated>2016-06-15T20:24:05Z</updated>

		<summary type="html">&lt;p&gt;Kurt: Add example of backward compatible macro&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a parent page for discussion about API changes being done for OpenSSL version 1.1&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to make most data structures opaque to applications.  This provides us with a number of benefits:&lt;br /&gt;
* We can add fields without breaking [[Binary_Compatibility|binary compatibility]]&lt;br /&gt;
* Applications are more robust and can be more assured about correctness&lt;br /&gt;
* It helps us determine which (new) accessors and settors, for example, are needed&lt;br /&gt;
&lt;br /&gt;
Please add sub-pages to discuss particular parts of the library as work progresses.&lt;br /&gt;
&lt;br /&gt;
== Major Changes so far ==&lt;br /&gt;
&lt;br /&gt;
* All structures in libssl public header files have been removed so that they are &amp;quot;opaque&amp;quot; to library users. You should use the provided accessor functions instead&lt;br /&gt;
* The old DES API has been removed&lt;br /&gt;
* bn, a sub library in libcrypto, has been made opaque&lt;br /&gt;
* Access to deprecated functions/macros has been removed by default. To enable access you must do two things. 1) Build OpenSSL with deprecation support (pass &amp;quot;enable-deprecated&amp;quot; as an argument to config) 2) Applications must define &amp;quot;OPENSSL_USE_DEPRECATED&amp;quot; before including OpenSSL header files&lt;br /&gt;
* HMAC_Init and HMAC_cleanup were previously stated in the docs and header files as being deprecated - but were not flagged in previous versions with OPENSSL_NO_DEPRECATED. This has been corrected in 1.1.0. Access to these functions/macros will be off by default in 1.1.0 as per the note above about deprecation.&lt;br /&gt;
&lt;br /&gt;
== OPENSSL_API_COMPAT ==&lt;br /&gt;
&lt;br /&gt;
Various functions get deprecated as other interfaces get added, but are still available in a default build.&lt;br /&gt;
The include files support setting the OPENSSL_API_COMPAT define that will hide functions that are deprecated in the selected version.&lt;br /&gt;
To select the 1.1.0 version use -DOPENSSL_API_COMPAT=0x10100000L.&lt;br /&gt;
&lt;br /&gt;
== Backward compatibility ==&lt;br /&gt;
&lt;br /&gt;
Since some structures have become opaque you can't directly access the member any more.  You might need to create backward compatible macros or functions if you still want to support older versions of OpenSSL.  A suggested way of doing that is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 #if OPENSSL_VERSION_NUMBER &amp;lt; 0x10100000L&lt;br /&gt;
 #define OBJ_get0_data(o) ((o)-&amp;gt;data)&lt;br /&gt;
 #define OBJ_length(o) ((o)-&amp;gt;length)&lt;br /&gt;
 #endif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Qt ==&lt;br /&gt;
&lt;br /&gt;
Here's what's broken in the dev branch of Qt when building openssl master as of 6 Feb 2015.&lt;br /&gt;
&lt;br /&gt;
* DH - we were directly accessing p and q to set the DH params to primes embedded in Qt. We can probably replace this with SSL_CTX_set_dh_auto(ctx, 1). Another option suggested by Steve Henson is to save the DHparams we're using at the moment then use d2i_DHparams to load them in. This is compatible with openssl versions that don't have the dh_auto option.&lt;br /&gt;
&lt;br /&gt;
* ctx-&amp;gt;cert_store - we were directly accessing the cert_store field of SSL_CTX. We can probably replace this with X509_STORE *SSL_CTX_get_cert_store(SSL_CTX *ctx) [Fixed in dev]&lt;br /&gt;
&lt;br /&gt;
* session-&amp;gt;tlsext_tick_lifetime_hint - we were directly accessing the lifetime hint of the session. [A new API to access this field has been added]&lt;br /&gt;
&lt;br /&gt;
* cipher-&amp;gt;valid - we were directly accessing the valid field of SSL_CIPHER. No replacement found. [This turned out not to be needed and so will be removed].&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Curl ==&lt;br /&gt;
&lt;br /&gt;
* SSL_SESSION-&amp;gt;ssl_version. Replaced with SSL_version(SSL *)&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in wget ==&lt;br /&gt;
&lt;br /&gt;
* SSL-&amp;gt;state. Replaced with SSL_state(SSL *)&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Apache Traffic Manager ==&lt;br /&gt;
&lt;br /&gt;
* Setting SSL-&amp;gt;rbio without setting SSL-&amp;gt;wbio. New function introduction in 1.1.0 to handle this: SSL_set_rbio()&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in OpenConnect ==&lt;br /&gt;
&lt;br /&gt;
In order to simulate &amp;quot;resume&amp;quot; of a DTLS session which never really existed but which was actually negotiated over the VPN control connection, [http://git.infradead.org/users/dwmw2/openconnect.git/blob/fa5cea08:/dtls.c#l147 this code] in the [http://www.infradead.org/openconnect/ OpenConnect VPN client] needs to set the following fields in a new &amp;lt;tt&amp;gt;SSL_SESSION&amp;lt;/tt&amp;gt;:&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;ssl_version&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;cipher{,_id}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;master_key{,_length}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;session_id{,_length}&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was fixed with [http://git.infradead.org/users/dwmw2/openconnect.git/commitdiff/5abb133f this OpenConnect commit] which makes it create the ASN.1 representation of the session and import it with &amp;lt;tt&amp;gt;d2i_SSL_SESSION()&amp;lt;/tt&amp;gt;. This is done conditionally in the above patch because it depends on the [http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=af674d4e20a82c2a98767b837072d7093c70b1cf fix in openssl HEAD] for &amp;lt;tt&amp;gt;d2i_SSL_SESSION()&amp;lt;/tt&amp;gt; to make it cope with &amp;lt;tt&amp;gt;DTLS1_BAD_VER&amp;lt;/tt&amp;gt; &amp;lt;i&amp;gt;([http://rt.openssl.org/Ticket/Display.html?id=3704 RT#3704])&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other simpler things which broke:&lt;br /&gt;
* &amp;lt;tt&amp;gt;SSL_CIPHER-&amp;gt;id&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;SSL_CIPHER_get_id()&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SSL_CTX-&amp;gt;extra_certs&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;SSL_CTX_get_extra_chain_certs_only()&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in TianoCore/EDKII ==&lt;br /&gt;
&lt;br /&gt;
EDKII is the reference implementation of UEFI firmware.&lt;br /&gt;
&lt;br /&gt;
* Various implicit inclusions of &amp;lt;tt&amp;gt;&amp;amp;lt;openssl/bn.h&amp;amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;amp;lt;openssl/rsa.h&amp;amp;gt;&amp;lt;/tt&amp;gt; needed to be made explicit. ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/8d7d32c1 (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;X509_NAME-&amp;gt;bytes-&amp;gt;{data,length}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;i2d_X509_NAME()&amp;lt;/tt&amp;gt; ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/e192c51b (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;X509_ATTRIBUTE-&amp;gt;{object,value}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;X509_ATTRIBUTE_get0_object()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;X509_ATTRIBUTE_get0_type()&amp;lt;/tt&amp;gt; ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/1bd8ee96 (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;ASN1_OBJECT-&amp;gt;{length,data}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;OBJ_get0_data()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OBJ_length()&amp;lt;/tt&amp;gt;. With backward-compatibility &amp;lt;tt&amp;gt;#define&amp;lt;/tt&amp;gt; of same. ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/6a7a36edc (commit)]''&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=OpenSSL_1.1.0_Changes&amp;diff=2403</id>
		<title>OpenSSL 1.1.0 Changes</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=OpenSSL_1.1.0_Changes&amp;diff=2403"/>
		<updated>2016-06-15T20:02:00Z</updated>

		<summary type="html">&lt;p&gt;Kurt: Add OPENSSL_API_COMPAT&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a parent page for discussion about API changes being done for OpenSSL version 1.1&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to make most data structures opaque to applications.  This provides us with a number of benefits:&lt;br /&gt;
* We can add fields without breaking [[Binary_Compatibility|binary compatibility]]&lt;br /&gt;
* Applications are more robust and can be more assured about correctness&lt;br /&gt;
* It helps us determine which (new) accessors and settors, for example, are needed&lt;br /&gt;
&lt;br /&gt;
Please add sub-pages to discuss particular parts of the library as work progresses.&lt;br /&gt;
&lt;br /&gt;
== Major Changes so far ==&lt;br /&gt;
&lt;br /&gt;
* All structures in libssl public header files have been removed so that they are &amp;quot;opaque&amp;quot; to library users. You should use the provided accessor functions instead&lt;br /&gt;
* The old DES API has been removed&lt;br /&gt;
* bn, a sub library in libcrypto, has been made opaque&lt;br /&gt;
* Access to deprecated functions/macros has been removed by default. To enable access you must do two things. 1) Build OpenSSL with deprecation support (pass &amp;quot;enable-deprecated&amp;quot; as an argument to config) 2) Applications must define &amp;quot;OPENSSL_USE_DEPRECATED&amp;quot; before including OpenSSL header files&lt;br /&gt;
* HMAC_Init and HMAC_cleanup were previously stated in the docs and header files as being deprecated - but were not flagged in previous versions with OPENSSL_NO_DEPRECATED. This has been corrected in 1.1.0. Access to these functions/macros will be off by default in 1.1.0 as per the note above about deprecation.&lt;br /&gt;
&lt;br /&gt;
== OPENSSL_API_COMPAT ==&lt;br /&gt;
&lt;br /&gt;
Various functions get deprecated as other interfaces get added, but are still available in a default build.&lt;br /&gt;
The include files support setting the OPENSSL_API_COMPAT define that will hide functions that are deprecated in the selected version.&lt;br /&gt;
To select the 1.1.0 version use -DOPENSSL_API_COMPAT=0x10100000L.&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Qt ==&lt;br /&gt;
&lt;br /&gt;
Here's what's broken in the dev branch of Qt when building openssl master as of 6 Feb 2015.&lt;br /&gt;
&lt;br /&gt;
* DH - we were directly accessing p and q to set the DH params to primes embedded in Qt. We can probably replace this with SSL_CTX_set_dh_auto(ctx, 1). Another option suggested by Steve Henson is to save the DHparams we're using at the moment then use d2i_DHparams to load them in. This is compatible with openssl versions that don't have the dh_auto option.&lt;br /&gt;
&lt;br /&gt;
* ctx-&amp;gt;cert_store - we were directly accessing the cert_store field of SSL_CTX. We can probably replace this with X509_STORE *SSL_CTX_get_cert_store(SSL_CTX *ctx) [Fixed in dev]&lt;br /&gt;
&lt;br /&gt;
* session-&amp;gt;tlsext_tick_lifetime_hint - we were directly accessing the lifetime hint of the session. [A new API to access this field has been added]&lt;br /&gt;
&lt;br /&gt;
* cipher-&amp;gt;valid - we were directly accessing the valid field of SSL_CIPHER. No replacement found. [This turned out not to be needed and so will be removed].&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Curl ==&lt;br /&gt;
&lt;br /&gt;
* SSL_SESSION-&amp;gt;ssl_version. Replaced with SSL_version(SSL *)&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in wget ==&lt;br /&gt;
&lt;br /&gt;
* SSL-&amp;gt;state. Replaced with SSL_state(SSL *)&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in Apache Traffic Manager ==&lt;br /&gt;
&lt;br /&gt;
* Setting SSL-&amp;gt;rbio without setting SSL-&amp;gt;wbio. New function introduction in 1.1.0 to handle this: SSL_set_rbio()&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in OpenConnect ==&lt;br /&gt;
&lt;br /&gt;
In order to simulate &amp;quot;resume&amp;quot; of a DTLS session which never really existed but which was actually negotiated over the VPN control connection, [http://git.infradead.org/users/dwmw2/openconnect.git/blob/fa5cea08:/dtls.c#l147 this code] in the [http://www.infradead.org/openconnect/ OpenConnect VPN client] needs to set the following fields in a new &amp;lt;tt&amp;gt;SSL_SESSION&amp;lt;/tt&amp;gt;:&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;ssl_version&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;cipher{,_id}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;master_key{,_length}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;-&amp;gt;session_id{,_length}&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was fixed with [http://git.infradead.org/users/dwmw2/openconnect.git/commitdiff/5abb133f this OpenConnect commit] which makes it create the ASN.1 representation of the session and import it with &amp;lt;tt&amp;gt;d2i_SSL_SESSION()&amp;lt;/tt&amp;gt;. This is done conditionally in the above patch because it depends on the [http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=af674d4e20a82c2a98767b837072d7093c70b1cf fix in openssl HEAD] for &amp;lt;tt&amp;gt;d2i_SSL_SESSION()&amp;lt;/tt&amp;gt; to make it cope with &amp;lt;tt&amp;gt;DTLS1_BAD_VER&amp;lt;/tt&amp;gt; &amp;lt;i&amp;gt;([http://rt.openssl.org/Ticket/Display.html?id=3704 RT#3704])&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other simpler things which broke:&lt;br /&gt;
* &amp;lt;tt&amp;gt;SSL_CIPHER-&amp;gt;id&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;SSL_CIPHER_get_id()&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;SSL_CTX-&amp;gt;extra_certs&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;SSL_CTX_get_extra_chain_certs_only()&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Things that Broke in TianoCore/EDKII ==&lt;br /&gt;
&lt;br /&gt;
EDKII is the reference implementation of UEFI firmware.&lt;br /&gt;
&lt;br /&gt;
* Various implicit inclusions of &amp;lt;tt&amp;gt;&amp;amp;lt;openssl/bn.h&amp;amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;amp;lt;openssl/rsa.h&amp;amp;gt;&amp;lt;/tt&amp;gt; needed to be made explicit. ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/8d7d32c1 (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;X509_NAME-&amp;gt;bytes-&amp;gt;{data,length}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;i2d_X509_NAME()&amp;lt;/tt&amp;gt; ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/e192c51b (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;X509_ATTRIBUTE-&amp;gt;{object,value}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;X509_ATTRIBUTE_get0_object()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;X509_ATTRIBUTE_get0_type()&amp;lt;/tt&amp;gt; ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/1bd8ee96 (commit)]''&lt;br /&gt;
* &amp;lt;tt&amp;gt;ASN1_OBJECT-&amp;gt;{length,data}&amp;lt;/tt&amp;gt;. Replaced with &amp;lt;tt&amp;gt;OBJ_get0_data()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OBJ_length()&amp;lt;/tt&amp;gt;. With backward-compatibility &amp;lt;tt&amp;gt;#define&amp;lt;/tt&amp;gt; of same. ''[http://git.infradead.org/users/dwmw2/edk2.git/commitdiff/6a7a36edc (commit)]''&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
</feed>