[rt-commit] r217 - in /redwax-tool/trunk: redwax-tool.h redwax_openssl.c

rt-commit at redwax.eu rt-commit at redwax.eu
Wed Apr 2 16:08:56 CEST 2025


Author: minfrin at redwax.eu
Date: Wed Apr  2 16:08:56 2025
New Revision: 217

Log:
Add TLS address to certificate metadata.

Modified:
    redwax-tool/trunk/redwax-tool.h
    redwax-tool/trunk/redwax_openssl.c

Modified: redwax-tool/trunk/redwax-tool.h
==============================================================================
--- redwax-tool/trunk/redwax-tool.h	(original)
+++ redwax-tool/trunk/redwax-tool.h	Wed Apr  2 16:08:56 2025
@@ -256,6 +256,7 @@
     const unsigned char *der;
     apr_size_t len;
     const char *origin;
+    const char *address;
     /* ID from the input certificate */
     const unsigned char *id_der;
     apr_size_t id_len;

Modified: redwax-tool/trunk/redwax_openssl.c
==============================================================================
--- redwax-tool/trunk/redwax_openssl.c	(original)
+++ redwax-tool/trunk/redwax_openssl.c	Wed Apr  2 16:08:56 2025
@@ -3866,6 +3866,7 @@
                     apr_pool_cleanup_null);
 
             cert->origin = apr_pstrdup(cert->pool, tls_host->hostname);
+            cert->address = apr_psprintf(cert->pool, "%pI", tls_host->sockaddr);
 
             rt_run_normalise_certificate(r, cert, 1);
 
@@ -5551,6 +5552,9 @@
 
     redwax_metadata_push_object(m, "Certificate", 0);
     redwax_metadata_add_string(m, "Origin", cert->origin);
+    if (cert->address) {
+        redwax_metadata_add_string(m, "Address", cert->address);
+    }
     if (cert->common.type == REDWAX_CERTIFICATE_X509 && cert->x509 &&
             cert->id_der && cert->id_len) {
         redwax_metadata_add_string(m, "Id",



More information about the rt-commit mailing list