static char *ssl_var_lookup_ssl_version(apr_pool_t *p, char *var);
static char *ssl_var_lookup_ssl_compress_meth(SSL *ssl);
-static int ssl_is_https(conn_rec *c)
+static SSLConnRec *ssl_get_effective_config(conn_rec *c)
{
SSLConnRec *sslconn = myConnConfig(c);
+ if (!(sslconn && sslconn->ssl) && c->master) {
+ /* use master connection if no SSL defined here */
+ sslconn = myConnConfig(c->master);
+ }
+ return sslconn;
+}
+
+static int ssl_is_https(conn_rec *c)
+{
+ SSLConnRec *sslconn = ssl_get_effective_config(c);
return sslconn && sslconn->ssl;
}
static apr_status_t ssl_get_tls_cb(apr_pool_t *p, conn_rec *c, const char *type,
unsigned char **buf, apr_size_t *size)
{
- SSLConnRec *sslconn = myConnConfig(c);
+ SSLConnRec *sslconn = ssl_get_effective_config(c);
const char *prefix;
apr_size_t preflen;
const unsigned char *data;
static const char *expr_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
{
char *var = (char *)data;
- SSLConnRec *sslconn = myConnConfig(ctx->c);
+ SSLConnRec *sslconn = ssl_get_effective_config(ctx->c);
return sslconn ? ssl_var_lookup_ssl(ctx->p, sslconn, ctx->r, var) : NULL;
}
* Connection stuff
*/
if (result == NULL && c != NULL) {
- SSLConnRec *sslconn = myConnConfig(c);
- if (!(sslconn && sslconn->ssl) && c->master) {
- /* use master connection if no SSL defined here */
- sslconn = myConnConfig(c->master);
- }
+ SSLConnRec *sslconn = ssl_get_effective_config(c);
if (strlen(var) > 4 && strcEQn(var, "SSL_", 4)
&& sslconn && sslconn->ssl)
result = ssl_var_lookup_ssl(p, sslconn, r, var+4);
apr_array_header_t *ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer,
const char *extension)
{
- SSLConnRec *sslconn = myConnConfig(c);
+ SSLConnRec *sslconn = ssl_get_effective_config(c);
SSL *ssl = NULL;
apr_array_header_t *array = NULL;
X509 *xs = NULL;
*/
static const char *ssl_var_log_handler_c(request_rec *r, char *a)
{
- SSLConnRec *sslconn = myConnConfig(r->connection);
+ SSLConnRec *sslconn = ssl_get_effective_config(r->connection);
char *result;
if (sslconn == NULL || sslconn->ssl == NULL)