/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * * Author : * Bertrand Guiheneuf * * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #ifdef HAVE_CONFIG_H #include #endif #include #ifdef HAVE_NSS #include #include #include "nss.h" /* Don't use <> here or it will include the system nss.h instead */ #include #endif /* HAVE_NSS */ #include "camel.h" #include "camel-certdb.h" #include "camel-mime-utils.h" gboolean camel_verbose_debug = FALSE; static void camel_shutdown (void) { CamelCertDB *certdb; #ifdef HAVE_NSS NSS_Shutdown (); PR_Cleanup (); #endif /* HAVE_NSS */ certdb = camel_certdb_get_default (); if (certdb) { camel_certdb_save (certdb); camel_object_unref (certdb); } } gint camel_init (const char *configdir, gboolean nss_init) { CamelCertDB *certdb; char *path; #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"); #endif /* G_THREADS_ENABLED */ #endif /* ENABLE_THREADS */ if (getenv ("CAMEL_VERBOSE_DEBUG")) camel_verbose_debug = TRUE; /* initialise global camel_object_type */ camel_object_get_type(); camel_mime_utils_init (); #ifdef HAVE_NSS if (nss_init) { PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 10); if (NSS_InitReadWrite (configdir) == SECFailure) { /* fall back on using volatile dbs? */ if (NSS_NoDB_Init (configdir) == 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); SSL_OptionSetDefault (SSL_V2_COMPATIBLE_HELLO, PR_TRUE /* maybe? */); } #endif /* HAVE_NSS */ path = g_strdup_printf ("%s/camel-cert.db", configdir); certdb = camel_certdb_new (); camel_certdb_set_filename (certdb, path); g_free (path); /* if we fail to load, who cares? it'll just be a volatile certdb */ camel_certdb_load (certdb); /* set this certdb as the default db */ camel_certdb_set_default (certdb); camel_object_unref (certdb); g_atexit (camel_shutdown); return 0; } qt'>
Commit message (Expand)AuthorAgeFilesLines
* Retire comment file.trevor2003-03-012-1/+1
* Use the full path to /sbin/sysctlkris2003-01-301-1/+1
* Actually all that needed to be done in this file to fix for 5-CURRENTobrien2003-01-011-26/+6
* Attempt to Fix build on -CURRENTarved2003-01-016-12/+142
* I'd like to try to maintain this.trevor2002-11-051-1/+1
* The effort to maintain these for FreeBSD just isn't worth it with the lackobrien2002-11-051-1/+1
* Use MASTER_SITES_GCC.knu2002-10-201-3/+2
* Due to popular demant into each port which might be inserted into dependencysobomax2002-09-141-0/+4
* Fix MASTER_SITES: gcc.gnu.org instead of egcs.cgynus.com, and also thegerald2002-07-311-1/+1
* Allow to build in -CURRENT.obrien2002-05-072-0/+70
* Catch up with Makefile rev 1.83.obrien2002-05-071-11/+2
* Remove the split up .info bits files. I switched to "makeinfo --no-split".obrien2002-05-071-54/+0
* Update pkg-comment to reflect GCC's new meaning (since 2.95) and refergerald2002-04-132-7/+7
* GCC 2.95 and later aren't called egcs (any longer), so remove three patchesgerald2002-04-123-36/+0
* Since I cannot think of any reason one would use this port for FORTRAN orobrien2002-04-101-15/+10
* Document.obrien2002-03-251-1/+1
* Let machine/ansi.h know not to play glibc for us.obrien2002-03-241-5/+13
* Use ${ECHO_CMD} instead of ${ECHO} where you mean the echo command;knu2002-01-291-6/+6
* Set these ports' LATEST_LINK to gcc{27,28,295,30} to avoid conflictknu2002-01-201-0/+2
* ftp.freesoftware.com -- R.I.P.obrien2001-09-141-2/+1
* Remove duplicate words where appropriate.dd2001-06-251-1/+1
* DEFAULT_VTABLE_THUNKS got set back to `1' from `2' in 2.95.3.obrien2001-04-171-2/+14
* Update to version 2.95.3.obrien2001-03-192-17/+15
* Use MASTER_SITE_SOURCEWARE.obrien2001-02-161-9/+6
* Update to the 3rd 2.95.3 pre-release (test) release.obrien2001-02-132-12/+13
* Introduce `TARGLIB' from gcc-devel to clean this thing up.obrien2001-01-081-16/+16
* Update to GCC 2.95.3 release candidate "test1"obrien2001-01-082-15/+17
* Make LIBSTDCPP_REV match the new reality.obrien2000-12-141-1/+1
* Change the libstdc++.so version number to be more like the stock one.obrien2000-12-061-1/+1
* Do dynamic PLIST creation like the `gcc-devel' port. This is the easiestobrien2000-12-062-229/+13
* Add "-Wnon-const-format" which checks for non-constant format strings forobrien2000-11-275-25/+234
* Use PLIST_SUB to only include curses.h when OSVERSION >= 400000. (Itasami2000-10-112-9/+15