[mod_gnutls-devel] [PATCH] Include GnuTLS version as additional version component in Server string

Benny Baumann BenBE at geshi.org
Wed Feb 12 22:03:14 CET 2014


It would be nice if mod_gnutls could add the used (runtime) version of
GnuTLS as an additional version component.

The below patch will add this information while falling back to using
the static version string (plus an indication) if the dynamic version
could not be constructed.

Regards,
BenBE.

---
 src/gnutls_hooks.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c
index 8e9a035..1006b34 100644
--- a/src/gnutls_hooks.c
+++ b/src/gnutls_hooks.c
@@ -452,6 +452,16 @@ int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp,
 
     ap_add_version_component(p, "mod_gnutls/" MOD_GNUTLS_VERSION);
 
+    {
+        char* gnutls_version = apr_psprintf(p, "GnuTLS/%s", gnutls_check_version(NULL));
+        if( !gnutls_version ) {
+            // In case we could not create the above string go for the static version instead
+            ap_add_version_component(p, "GnuTLS/" GNUTLS_VERSION "-static");
+        } else {
+            ap_add_version_component(p, gnutls_version);
+        }
+    }
+
     return OK;
 }
 
-- 
1.8.3.2




More information about the mod_gnutls-devel mailing list