for(i = 0; i < MAX_VHOSTS; i++) {
config.vhosts[i].sslkey = NULL;
config.vhosts[i].sslcert = NULL;
+ config.vhosts[i].root = NULL;
}
config.root.sslkey = NULL;
config.root.sslcert = NULL;
+ config.root.root = NULL;
config.vhost_count = 0;
config.module_count = 0;
config.extension = NULL;
if(current->sslcert != NULL) free(current->sslcert);
current->sslcert = cm_strdup(r[1]);
}
+ } else if(cm_strcaseequ(r[0], "DocumentRoot")) {
+ if(r[1] == NULL) {
+ cm_log("Config", "Missing path at line %d", ln);
+ stop = 1;
+ } else {
+ if(current->root != NULL) free(current->root);
+ current->root = cm_strdup(r[1]);
+ }
} else if(cm_strcaseequ(r[0], "ServerRoot")) {
if(r[1] == NULL) {
cm_log("Config", "Missing path at line %d", ln);
SSL_use_PrivateKey_file(ssl, e->sslkey, SSL_FILETYPE_PEM);
SSL_use_certificate_file(ssl, e->sslcert, SSL_FILETYPE_PEM);
return 1;
+ } else if(config.root.sslkey != NULL && config.root.sslcert != NULL) {
+ SSL_use_PrivateKey_file(ssl, config.root.sslkey, SSL_FILETYPE_PEM);
+ SSL_use_certificate_file(ssl, config.root.sslcert, SSL_FILETYPE_PEM);
} else {
return 0;
}