diff options
Diffstat (limited to 'camel/camel.c')
-rw-r--r-- | camel/camel.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/camel/camel.c b/camel/camel.c index c451045c32..4aa4512722 100644 --- a/camel/camel.c +++ b/camel/camel.c @@ -28,6 +28,7 @@ #include <unicode.h> #ifdef HAVE_NSS #include <mozilla/nspr.h> +#include <mozilla/prthread.h> #include <nss.h> #include <ssl.h> #endif /* HAVE_NSS */ @@ -35,13 +36,13 @@ gboolean camel_verbose_debug = FALSE; gint -camel_init (void) +camel_init (const char *certdb) { #ifdef ENABLE_THREADS #ifdef G_THREADS_ENABLED /*g_thread_init (NULL);*/ #else /* G_THREADS_ENABLED */ - g_warning ("Threads are not supported by your version of glib\n"); + g_warning ("Threads are not supported by your version of glib"); #endif /* G_THREADS_ENABLED */ #endif /* ENABLE_THREADS */ @@ -51,6 +52,15 @@ camel_init (void) unicode_init (); #ifdef HAVE_NSS + PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 10); + + if (NSS_Init (certdb) == SECFailure) { + g_warning ("Failed to initialize NSS"); + return -1; + } + + NSS_SetDomesticPolicy (); + SSL_OptionSetDefault (SSL_ENABLE_SSL2, PR_TRUE); SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE); SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE); @@ -59,3 +69,13 @@ camel_init (void) return 0; } + +void +camel_shutdown (void) +{ +#ifdef HAVE_NSS + NSS_Shutdown (); + + PR_Cleanup (); +#endif /* HAVE_NSS */ +} |