mirror of
https://github.com/apache/httpd.git
synced 2025-08-01 07:26:57 +03:00
avoid calling ssl_util_vhostid() (and apr_sprintf underneath) at
request time by calling it at startup time and saving the value in the SSLSrvConfigRec. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92215 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -221,7 +221,6 @@ static int ssl_hook_pre_connection(conn_rec *c)
|
||||
{
|
||||
SSLSrvConfigRec *sc = mySrvConfig(c->base_server);
|
||||
SSL *ssl;
|
||||
unsigned char *cpVHostID;
|
||||
char *cpVHostMD5;
|
||||
SSLConnRec *sslconn = apr_pcalloc(c->pool, sizeof(*sslconn));
|
||||
|
||||
@ -241,9 +240,9 @@ static int ssl_hook_pre_connection(conn_rec *c)
|
||||
* Remember the connection information for
|
||||
* later access inside callback functions
|
||||
*/
|
||||
cpVHostID = (unsigned char *)ssl_util_vhostid(c->pool,c->base_server);
|
||||
|
||||
ssl_log(c->base_server, SSL_LOG_INFO, "Connection to child %d established "
|
||||
"(server %s, client %s)", c->id, cpVHostID,
|
||||
"(server %s, client %s)", c->id, sc->szVHostID,
|
||||
c->remote_ip != NULL ? c->remote_ip : "unknown");
|
||||
|
||||
/*
|
||||
@ -263,7 +262,7 @@ static int ssl_hook_pre_connection(conn_rec *c)
|
||||
return DECLINED; /* XXX */
|
||||
}
|
||||
SSL_clear(ssl);
|
||||
cpVHostMD5 = ap_md5(c->pool, cpVHostID);
|
||||
cpVHostMD5 = ap_md5(c->pool, sc->szVHostID);
|
||||
if (!SSL_set_session_id_context(ssl, (unsigned char *)cpVHostMD5,
|
||||
MD5_DIGESTSIZE*2)) {
|
||||
ssl_log(c->base_server, SSL_LOG_ERROR|SSL_ADD_SSLERR,
|
||||
|
@ -497,6 +497,7 @@ typedef struct {
|
||||
* and all <VirtualHost> contexts)
|
||||
*/
|
||||
typedef struct {
|
||||
const char *szVHostID;
|
||||
BOOL bEnabled;
|
||||
apr_table_t *ap_server_ctx;
|
||||
const char *szPublicCertFile[SSL_AIDX_MAX];
|
||||
|
@ -190,6 +190,7 @@ void *ssl_config_server_merge(apr_pool_t *p, void *basev, void *addv)
|
||||
SSLSrvConfigRec *add = (SSLSrvConfigRec *)addv;
|
||||
SSLSrvConfigRec *new = (SSLSrvConfigRec *)apr_palloc(p, sizeof(SSLSrvConfigRec));
|
||||
|
||||
cfgMergeString(szVHostID);
|
||||
cfgMergeBool(bEnabled);
|
||||
cfgMergeString(szCACertificatePath);
|
||||
cfgMergeString(szCACertificateFile);
|
||||
|
@ -476,7 +476,7 @@ void ssl_init_ConfigureServer(server_rec *s, apr_pool_t *p, SSLSrvConfigRec *sc)
|
||||
/*
|
||||
* Create the server host:port string because we need it a lot
|
||||
*/
|
||||
cpVHostID = ssl_util_vhostid(p, s);
|
||||
sc->szVHostID = cpVHostID = ssl_util_vhostid(p, s);
|
||||
|
||||
/*
|
||||
* Now check for important parameters and the
|
||||
|
Reference in New Issue
Block a user