]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: exit when setting ciphers fails (GNUTLS) 7718/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 11 Apr 2019 15:30:20 +0000 (17:30 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 11 Apr 2019 15:30:20 +0000 (17:30 +0200)
Before, we would log the fact that we could not set the ciphers for
gnutls but still start. When a connection came in, dnsdist would crash.

pdns/dnsdistdist/tcpiohandler.cc

index 3ee1f46c35b83d42fbb53d4633b686aad85861c6..32731c85b5a5c21dc174c819f1e0f5cca34e899d 100644 (file)
@@ -958,7 +958,7 @@ public:
 
     rc = gnutls_priority_init(&d_priorityCache, fe.d_ciphers.empty() ? "NORMAL" : fe.d_ciphers.c_str(), nullptr);
     if (rc != GNUTLS_E_SUCCESS) {
-      warnlog("Error setting up TLS cipher preferences to %s (%s), skipping.", fe.d_ciphers.c_str(), gnutls_strerror(rc));
+      throw std::runtime_error("Error setting up TLS cipher preferences to '" + fe.d_ciphers + "' (" + gnutls_strerror(rc) + ") on " + fe.d_addr.toStringWithPort());
     }
 
     pthread_rwlock_init(&d_lock, nullptr);