diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-01-15 14:25:23 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-01-15 14:25:23 +0800 |
commit | e12bc65aa5c4d6137d98471c245c24502f8a0b87 (patch) | |
tree | dfc599f9a7c8f92ae6d35d4e7777775c5ec99291 /camel/camel.c | |
parent | a27517d2d749bda92eb9232840bf8a87cd3ae80a (diff) | |
download | gsoc2013-evolution-e12bc65aa5c4d6137d98471c245c24502f8a0b87.tar.gz gsoc2013-evolution-e12bc65aa5c4d6137d98471c245c24502f8a0b87.tar.zst gsoc2013-evolution-e12bc65aa5c4d6137d98471c245c24502f8a0b87.zip |
Uses an SSL socket now although there's still a few things missing (like
2001-01-15 Jeffrey Stedfast <fejj@ximian.com>
* camel-tcp-stream-ssl.c (stream_connect): Uses an SSL socket now
although there's still a few things missing (like certificate
handling and such).
* camel.c (camel_ssl_init): A replacement function for
camel_init() that also initializes SSL.
svn path=/trunk/; revision=7494
Diffstat (limited to 'camel/camel.c')
-rw-r--r-- | camel/camel.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/camel/camel.c b/camel/camel.c index 2d2272057a..5383c4d32a 100644 --- a/camel/camel.c +++ b/camel/camel.c @@ -47,3 +47,42 @@ camel_init(void) return 0; } + +#ifdef U_CANT_TOUCH_THIS +#include <ssl.h> +#include <nss.h> + +gint +camel_ssl_init (char *configdir, gboolean nss_init) +{ +#ifdef ENABLE_THREADS +#ifdef G_THREADS_ENABLED + /*g_thread_init (NULL);*/ +#else /* G_THREADS_ENABLED */ + printf ("Threads are not supported by your version of glib\n"); +#endif /* G_THREADS_ENABLED */ +#endif /* ENABLE_THREADS */ + + if (getenv ("CAMEL_VERBOSE_DEBUG")) + camel_verbose_debug = TRUE; + + unicode_init (); + + if (nss_init) { + PR_init (); + + if (NSS_init (configdir) == SECFailure) + return -1; + + /* FIXME: Erm, use appropriate policy? */ + NSS_SetDomesticPolicy (); + } + + SSL_OptionSetDefault (SSL_ENABLE_SSL2, PR_TRUE); + SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE); + SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE); + SSL_OptionSetDefault (SSL_V2_COMPATIBLE_HELLO, PR_TRUE /* maybe? */); + + return 0; +} +#endif |