]> code.citadel.org Git - citadel.git/blobdiff - webcit/crypto.c
* Allow the '-S' command line option, so the cipher suites can be specified without...
[citadel.git] / webcit / crypto.c
index 8f89948a13c85c2bb37b4995afe4208472bf76a0..344dc6a5a83c41999b8ab840ab74cb93408638da 100644 (file)
@@ -17,6 +17,7 @@
 
 SSL_CTX *ssl_ctx;              /* SSL context */
 pthread_mutex_t **SSLCritters; /* Things needing locking */
+char *ssl_cipher_list = DEFAULT_SSL_CIPHER_LIST;
 
 pthread_key_t ThreadSSL;       /* Per-thread SSL context */
 
@@ -91,8 +92,13 @@ void init_ssl(void)
        SSL_load_error_strings();
        ssl_method = SSLv23_server_method();
        if (!(ssl_ctx = SSL_CTX_new(ssl_method))) {
-               lprintf(3, "SSL_CTX_new failed: %s\n",
-                       ERR_reason_error_string(ERR_get_error()));
+               lprintf(3, "SSL_CTX_new failed: %s\n", ERR_reason_error_string(ERR_get_error()));
+               return;
+       }
+
+       lprintf(9, "Requesting cipher list: %s\n", ssl_cipher_list);
+       if (!(SSL_CTX_set_cipher_list(ssl_ctx, ssl_cipher_list))) {
+               lprintf(3, "SSL_CTX_set_cipher_list failed: %s\n", ERR_reason_error_string(ERR_get_error()));
                return;
        }
 
@@ -151,7 +157,7 @@ void init_ssl(void)
                                                        NULL    /* no callbk */
                                ) != 1) {
                                        lprintf(3, "Cannot write key: %s\n",
-                                               ERR_reason_error_string(ERR_get_error()));
+                                               ERR_reason_error_string(ERR_get_error()));
                                        unlink(CTDL_KEY_PATH);
                                }
                                fclose(fp);