try {
frontend->d_addr = ComboAddress(addr, 853);
- vinfolog("Loading TLS provider %s", frontend->d_provider);
+ if (!frontend->d_provider.empty()) {
+ vinfolog("Loading TLS provider '%s'", frontend->d_provider);
+ }
+ else {
+ vinfolog("Loading default TLS provider 'openssl'");
+ }
// only works pre-startup, so no sync necessary
auto cs = std::unique_ptr<ClientState>(new ClientState(frontend->d_addr, true, reusePort, tcpFastOpenQueueSize, interface, cpus));
cs->tlsFrontend = frontend;
* ``tcpFastOpenQueueSize=0``: int - Set the TCP Fast Open queue size, enabling TCP Fast Open when available and the value is larger than 0.
* ``interface=""``: str - Set the network interface to use.
* ``cpus={}``: table - Set the CPU affinity for this listener thread, asking the scheduler to run it on a single CPU id, or a set of CPU ids. This parameter is only available if the OS provides the pthread_setaffinity_np() function.
- * ``provider``: str - The TLS library to use between GnuTLS and OpenSSL, if they were available and enabled at compilation time.
+ * ``provider``: str - The TLS library to use between GnuTLS and OpenSSL, if they were available and enabled at compilation time. Default is to use OpenSSL when available.
* ``ciphers``: str - The TLS ciphers to use. The exact format depends on the provider used. When the OpenSSL provder is used, ciphers for TLS 1.3 must be specified via ``ciphersTLS13``.
* ``ciphersTLS13``: str - The ciphers to use for TLS 1.3, when the OpenSSL provider is used. When the GnuTLS provider is used, ``ciphers`` applies regardless of the TLS protocol and this setting is not used.
* ``numberOfTicketsKeys``: int - The maximum number of tickets keys to keep in memory at the same time, if the provider supports it (GnuTLS doesn't, OpenSSL does). Only one key is marked as active and used to encrypt new tickets while the remaining ones can still be used to decrypt existing tickets after a rotation. Default to 5.
}
#endif /* HAVE_LIBSSL */
}
-#ifdef HAVE_GNUTLS
- d_ctx = std::make_shared<GnuTLSIOCtx>(*this);
-#else /* HAVE_GNUTLS */
#ifdef HAVE_LIBSSL
d_ctx = std::make_shared<OpenSSLTLSIOCtx>(*this);
-#endif /* HAVE_LIBSSL */
+#else /* HAVE_LIBSSL */
+#ifdef HAVE_GNUTLS
+ d_ctx = std::make_shared<GnuTLSIOCtx>(*this);
#endif /* HAVE_GNUTLS */
+#endif /* HAVE_LIBSSL */
#endif /* HAVE_DNS_OVER_TLS */
return true;