Warning
This documentation assumes the reader has basic knowledge of TLS concepts since terms like Certificate Authority (CA), Private Key, Rivest–Shamir–Adleman (RSA) cryptosystem, and Diffie-Hellman encryption protocol are not explained in detail.
Fast DDS allows configuring TCP Transports to use TLS (Transport Layer Security).
In order to set up TLS, the :ref:`transport_tcp_transportDescriptor` must
have its |TCPTransportDescriptor::apply_security-api| data member set to true
, and its
|TCPTransportDescriptor::tls_config-api| data member filled with the desired configuration on the
|TCPTransportDescriptor-api|.
The following is an example of configuration of TLS on the TCP server.
.. tabs:: .. tab:: C++ .. literalinclude:: /../code/DDSCodeTester.cpp :language: c++ :start-after: //CONF-TCP-TLS-SERVER :end-before: //!-- :dedent: 8 .. tab:: XML .. literalinclude:: /../code/XMLTester.xml :language: xml :start-after: <!-->CONF-TCP-TLS-SERVER :end-before: <!--><--> :lines: 2-3,5- :append: </profiles>
The corresponding configuration on the TCP client is shown in the following example.
.. tabs:: .. tab:: C++ .. literalinclude:: /../code/DDSCodeTester.cpp :language: c++ :start-after: //CONF-TCP-TLS-CLIENT :end-before: //!-- :dedent: 8 .. tab:: XML .. literalinclude:: /../code/XMLTester.xml :language: xml :start-after: <!-->CONF-TCP-TLS-CLIENT :end-before: <!--><--> :lines: 2-3,5- :append: </profiles>
The following table describes the data members that are configurable on |TCPTransportDescriptor::TLSConfig-api|.
Note
Fast DDS uses the Boost.Asio library to handle TLS secure connections. These data members are used to build the asio library context, and most of them are mapped directly into this context without further manipulation. You can find more information about the implications of each member on the Boost.Asio context documentation.
The verification mode defines how the peer node will be verified. The following table describes the available verification options. Several verification options can be combined in the same |TCPTransportDescriptor-api| using the |TCPTransportDescriptor::TLSConfig::add_verify_mode-api| member function.
Value | Description |
---|---|
|TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_NONE-api| | Perform no verification. |
|TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_PEER-api| | Perform verification of the peer. |
|TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_FAIL_IF_NO_PEER_CERT-api| | Fail verification if the peer has no certificate. Ignored unless |TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_PEER-api| is also set. |
|TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_CLIENT_ONCE-api| | Do not request client certificate on renegotiation. Ignored unless |TCPTransportDescriptor::TLSConfig::TLSVerifyMode::VERIFY_PEER-api| is also set. |
Note
For a complete description of the different verification modes, please refer to the OpenSSL documentation.
These options define which TLS features are to be supported. The following table describes the available options. Several options can be combined in the same TransportDescriptor using the |TCPTransportDescriptor::TLSConfig::add_option-api| member function.
Value | Description |
---|---|
|TCPTransportDescriptor::TLSConfig::TLSOptions::DEFAULT_WORKAROUNDS-api| | Implement various bug workarounds. See Boost.Asio context. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::NO_COMPRESSION-api| | Disable compression. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::NO_SSLV2-api| | Disable SSL v2. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::NO_SSLV3-api| | Disable SSL v3. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1-api| | Disable TLS v1. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_1-api| | Disable TLS v1.1. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_2-api| | Disable TLS v1.2. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::NO_TLSV1_3-api| | Disable TLS v1.3. |
|TCPTransportDescriptor::TLSConfig::TLSOptions::SINGLE_DH_USE-api| | Always create a new key when using Diffie-Hellman parameters. |
The role can take the following values:
Value | Description |
---|---|
|TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::DEFAULT-api| | Configured as client if connector, and as server if acceptor |
|TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::CLIENT-api| | Configured as client. |
|TCPTransportDescriptor::TLSConfig::TLSHandShakeRole::SERVER-api| | Configured as server. |