X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fcrypto%2Fserv_crypto.c;fp=citadel%2Fmodules%2Fcrypto%2Fserv_crypto.c;h=310150af8f1d400a6041465757fc6871c51b98e8;hb=41a68e93ee5d46eec3cf12f4614e53c1bac84e43;hp=dcbab519ec2f01a8cb90ab932fcd7ab3d7ac16f2;hpb=c3f4724c1d230b6ff86426702e9de9241518ebd6;p=citadel.git diff --git a/citadel/modules/crypto/serv_crypto.c b/citadel/modules/crypto/serv_crypto.c index dcbab519e..310150af8 100644 --- a/citadel/modules/crypto/serv_crypto.c +++ b/citadel/modules/crypto/serv_crypto.c @@ -268,15 +268,20 @@ void update_key_and_cert_if_needed(void) { // Initialize the SSL/TLS subsystem. void init_ssl(void) { - SSL_library_init(); // Initialize SSL transport layer + + // Initialize the OpenSSL library SSL_load_error_strings(); + ERR_load_crypto_strings(); + OpenSSL_add_all_algorithms(); + SSL_library_init(); + // Load (or generate) a key and certificate mkdir(ctdl_key_dir, 0700); // If the keys directory does not exist, create it generate_key(file_crpt_file_key); // If a private key does not exist, create it generate_certificate(file_crpt_file_key, file_crpt_file_cer); // If a certificate does not exist, create it bind_to_key_and_certificate(); // Load key and cert from disk, and bind to them. - // Finally let the server know we're here + // Register some Citadel protocol commands for dealing with encrypted sessions CtdlRegisterProtoHook(cmd_stls, "STLS", "Start SSL/TLS session"); CtdlRegisterProtoHook(cmd_gtls, "GTLS", "Get SSL/TLS session status"); CtdlRegisterSessionHook(endtls, EVT_STOP, PRIO_STOP + 10);