Commit c5c81240 authored by Geoff Simmons's avatar Geoff Simmons

Add libcrypto_version().

parent 2a6c53fe
......@@ -33,6 +33,10 @@ varnish v1 -vcl {
if (!resp.http.x-version) {
set resp.status = 500;
}
set resp.http.x-libcrypto-version = ece.libcrypto_version();
if (!resp.http.x-libcrypto-version) {
set resp.status = 500;
}
return(deliver);
}
}
......@@ -42,4 +46,5 @@ client c1 {
rxresp
expect resp.status == 200
expect resp.http.x-version ~ "^.+$"
expect resp.http.x-libcrypto-version ~ "^.+$"
} -run
......@@ -28,6 +28,8 @@
#include "config.h"
#include <openssl/crypto.h>
#include "cache/cache.h"
#include "vcc_if.h"
......@@ -59,6 +61,16 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
NEEDLESS(return (0));
}
VCL_STRING
vmod_libcrypto_version(VRT_CTX)
{
(void)ctx;
VCL_STRING version = OpenSSL_version(OPENSSL_VERSION);
if (version == NULL)
return "unknown libcrypto version";
return version;
}
VCL_STRING
vmod_version(VRT_CTX)
{
......
......@@ -56,6 +56,14 @@ Encryption and HTTP
XXX ...
$Function STRING libcrypto_version()
Return the libcrypto version string.
Example::
std.log("Using libcrypto version: " + ece.libcrypto_version());
$Function STRING version()
Return the version string for this VMOD.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment