added SSL support for POP using OpenSSL
[claws.git] / src / main.c
index b7bac27..61f4419 100644 (file)
@@ -83,6 +83,10 @@ gboolean debug_mode = FALSE;
 static gint lock_socket = -1;
 static gint lock_socket_tag = 0;
 
+#if USE_SSL
+SSL_CTX *ssl_ctx;
+#endif
+
 static struct Cmd {
        gboolean receive;
        gboolean receive_all;
@@ -233,6 +237,22 @@ int main(int argc, char *argv[])
        gpgme_register_idle(idle_function_for_gpgme);
 #endif
 
+#if USE_SSL
+       {
+               SSL_METHOD *meth;
+               
+               SSLeay_add_ssl_algorithms();
+               meth = SSLv2_client_method();
+               SSL_load_error_strings();
+               ssl_ctx = SSL_CTX_new(meth);
+               if(ssl_ctx == NULL) {
+                       debug_print(_("SSL disabled\n"));
+               } else {
+                       debug_print(_("SSL loaded: \n"));
+               }
+       }
+#endif
+
        prefs_common_save_config();
        prefs_filter_read_config();
        prefs_filter_write_config();
@@ -278,6 +298,12 @@ int main(int argc, char *argv[])
 
        gtk_main();
 
+#if USE_SSL
+       if(ssl_ctx) {
+               SSL_CTX_free(ssl_ctx);
+       }
+#endif
+
        return 0;
 }