]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/crypto/serv_crypto.c
FFFFFFFFFFFFFFFFFUUUUUUUUUUUUUuu----------------
[citadel.git] / citadel / modules / crypto / serv_crypto.c
index ee03fdaef91357e815791b9ffb43ef1962ab29e6..16fb4f57e03f19fdb41a2fbeaf4bc8c52fbd198c 100644 (file)
@@ -216,7 +216,14 @@ void bind_to_key_and_certificate(void) {
        SSL_CTX *old_ctx = NULL;
        SSL_CTX *new_ctx = NULL;
 
-       if (!(new_ctx = SSL_CTX_new(TLS_server_method()))) {
+       const SSL_METHOD *method = SSLv23_server_method();
+       if (!method) {
+               syslog(LOG_ERR, "crypto: TLS_server_method() failed: %s", ERR_reason_error_string(ERR_get_error()));
+               return;
+       }
+
+       new_ctx = SSL_CTX_new(method);
+       if (!new_ctx) {
                syslog(LOG_ERR, "crypto: SSL_CTX_new failed: %s", ERR_reason_error_string(ERR_get_error()));
                return;
        }
@@ -270,10 +277,8 @@ void update_key_and_cert_if_needed(void) {
 void init_ssl(void) {
 
        // Initialize the OpenSSL library
-       SSL_load_error_strings();
-       ERR_load_crypto_strings();
-       OpenSSL_add_all_algorithms();
        SSL_library_init();
+       SSL_load_error_strings();
 
        // Load (or generate) a key and certificate
        mkdir(ctdl_key_dir, 0700);                                      // If the keys directory does not exist, create it