From: Paul Querna Date: Thu, 5 May 2005 23:15:20 +0000 (+0000) Subject: Add support for 'Protocol' to mod_ssl. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=336ce4498823602acee17bbf2bc5ca8a6f96483e;p=thirdparty%2Fapache%2Fhttpd.git Add support for 'Protocol' to mod_ssl. Example Config: Listen 10.0.0.10:443 https SLCertificateFile conf/server.cert SSLCertificateKeyFile conf/server.key ServerName foo:443 DocumentRoot /var/www/foo .... Notice, no need for 'SSLEngine on'. You can also set 'Protocol https' inside the virtual host, if you do not set it in the Listen command. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/listen-protocol@168462 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c index 90094df44fb..1f397afab5d 100644 --- a/modules/ssl/ssl_engine_init.c +++ b/modules/ssl/ssl_engine_init.c @@ -207,8 +207,13 @@ int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog, sc->vhost_id = ssl_util_vhostid(p, s); sc->vhost_id_len = strlen(sc->vhost_id); + if (strcmp("https", ap_get_server_protocol(s)) == 0) { + sc->enabled = SSL_ENABLED_TRUE; + } + /* If sc->enabled is UNSET, then SSL is optional on this vhost */ /* Fix up stuff that may not have been set */ + if (sc->enabled == SSL_ENABLED_UNSET) { sc->enabled = SSL_ENABLED_FALSE; } @@ -879,7 +884,8 @@ static void ssl_init_server_certs(server_rec *s, if (!(have_rsa || have_dsa)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, - "Oops, no RSA or DSA server certificate found?!"); + "Oops, no RSA or DSA server certificate found " + "for '%s:%d'?!", s->server_hostname, s->port); ssl_die(); }