Index: modules/ssl/ssl_engine_vars.c
===================================================================
--- modules/ssl/ssl_engine_vars.c   (revision 1630015)
+++ modules/ssl/ssl_engine_vars.c   (working copy)
@@ -73,7 +73,9 @@
 static const char *expr_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
 {
     char *var = (char *)data;
-    return ssl_var_lookup_ssl(ctx->p, ctx->c, ctx->r, var);
+    SSLConnRec *sslconn = myConnConfig(ctx->c);
+
+    return sslconn ? ssl_var_lookup_ssl(ctx->p, ctx->c, ctx->r, var) : "";
 }
 
 static int ssl_expr_lookup(ap_expr_lookup_parms *parms)
