--- ssl_engine_kernel.c.orig 2009-05-20 10:19:06.000000000 +0300 +++ ssl_engine_kernel.c.orig 2009-05-20 10:19:40.000000000 +0300 @@ -29,6 +29,7 @@ time I was too famous.'' -- Unknown */ #include "ssl_private.h" +#include "util_md5.h" static void ssl_configure_env(request_rec *r, SSLConnRec *sslconn); @@ -610,16 +611,18 @@ int ssl_hook_Access(request_rec *r) } } else { - request_rec *id = r->main ? r->main : r; + char *vhost_md5; /* do a full renegotiation */ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "Performing full renegotiation: " "complete handshake protocol"); - SSL_set_session_id_context(ssl, - (unsigned char *)&id, - sizeof(id)); + vhost_md5 = ap_md5_binary(r->pool, (unsigned char *)sc->vhost_id, + sc->vhost_id_len); + + SSL_set_session_id_context(ssl, (unsigned char *)vhost_md5, + APR_MD5_DIGESTSIZE*2); SSL_renegotiate(ssl); SSL_do_handshake(ssl);