]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Link in gnutls provider and provide verify error status method for it
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 6 Oct 2025 10:01:49 +0000 (12:01 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 9 Oct 2025 13:43:50 +0000 (15:43 +0200)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/meson.build
pdns/recursordist/meson_options.txt
pdns/tcpiohandler.cc

index 82c7f59c5d3b5a8ce2af7ab10f2633fbf8c26456..c26daf333a1960e78387ba8fc9bf6bd7377fcb72 100644 (file)
@@ -83,6 +83,7 @@ subdir('meson' / 'dnstap')                  # DNSTAP through libfstream
 subdir('meson' / 'libcurl')                 # Curl
 subdir('meson' / 'libcap')                  # Capabilities
 subdir('meson' / 'dlopen')                  # our Rust static library needs dlopen
+subdir('meson' / 'gnutls')                  # GNUTLS
 
 subdir('rec-rust-lib')
 
@@ -327,6 +328,7 @@ deps = [
   dep_libsnmp,
   dep_libsodium,
   dep_libssl,
+  dep_gnutls,
   dep_lua,
   dep_protozero,
   dep_yahttp_header_only,
index e1f6d7545e17600884a2378d9e3eb26e3b12befc..bfd986313f98b45aa9146e1a50f0f6cc591a6c59 100644 (file)
@@ -24,3 +24,4 @@ option('libcurl', type: 'feature', value: 'auto', description: 'Enable Curl supp
 option('nod', type: 'feature', value: 'enabled', description: 'Enable Newly Observed Domains')
 option('libcap', type: 'feature', value: 'auto', description: 'Enable libcap for capabilities handling')
 option('clang-coverage-format', type: 'boolean', value: false, description: 'Whether to generate coverage data in clang format')
+option('tls-gnutls', type: 'feature', value: 'auto', description: 'GnuTLS-based TLS')
index d0450680dccd22ca328455f2132b38caf27c3ff7..31a452601c5db672fbf8adc64cdc786a21bda365 100644 (file)
@@ -1630,7 +1630,17 @@ public:
 
   [[nodiscard]] std::pair<long, std::string> getVerifyResult() const override
   {
-    return {-1, "Not implemented yet"};
+    if (d_conn) {
+      auto status = gnutls_session_get_verify_cert_status(d_conn.get());
+      gnutls_datum_t out{};
+      if (gnutls_certificate_verification_status_print(status, GNUTLS_CRT_X509, &out, 0) == 0) {
+        auto errString = std::string(reinterpret_cast<const char*>(out.data), out.size);
+        gnutls_free(out.data);
+        return {status, errString};
+      }
+      return {status, ""};
+    }
+    return {0, ""};
   }
 
   bool hasSessionBeenResumed() const override