X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcrypto.c;h=76c80d4de8df5aad59ab963bc62c7e4208655a6c;hb=a14993160a97c3092d3bd6d015b06021a8ed6171;hp=1515ff39762e4a195f00d1435947dd4151d00acf;hpb=5bcb36c908199452c652b3592126896320c57617;p=citadel.git diff --git a/webcit/crypto.c b/webcit/crypto.c index 1515ff397..76c80d4de 100644 --- a/webcit/crypto.c +++ b/webcit/crypto.c @@ -152,10 +152,12 @@ void init_ssl(void) } } - /** - * Generate a CSR if we don't have one. + /* + * If there is no certificate file on disk, we will be generating a self-signed certificate + * in the next step. Therefore, if we have neither a CSR nor a certificate, generate + * the CSR in this step so that the next step may commence. */ - if (access(CTDL_CSR_PATH, R_OK) != 0) { + if ( (access(CTDL_CER_PATH, R_OK) != 0) && (access(CTDL_CSR_PATH, R_OK) != 0) ) { lprintf(5, "Generating a certificate signing request.\n"); /**