summaryrefslogtreecommitdiff
path: root/libsoup/soup-misc.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-11-05 19:45:46 +0000
committerDan Winship <danw@src.gnome.org>2002-11-05 19:45:46 +0000
commitd4629510fb547f3ed2cce829ea1ec0c73bc5647c (patch)
tree19ee5b614bf12a0aa2ebd29d8a9fd2535dea8386 /libsoup/soup-misc.c
parent6314c214c92e43c84be54754013580ecb475b486 (diff)
downloadlibsoup-d4629510fb547f3ed2cce829ea1ec0c73bc5647c.tar.gz
Split libsoup out of soup. ChangeLog.old contains the original soup
* Split libsoup out of soup. ChangeLog.old contains the original soup ChangeLog. * Makefile.am, etc: Fix things up to work with the new directory layout. Disable docs until we fix them. * autogen.sh: Use gnome-autogen.sh * configure.in: Require autoconf 2.53. Remove stuff that was only needed for httpd or wsdl code. Remove glib1 support. Bump version to 2.0. * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes in ${includedir}/soup-2.0 * libsoup/*: Merge soup-0-7 back onto the trunk. Remove SOAP-specific stuff, Windows support, and other things that weren't being maintained. * soup-config.in, soupConf.sh: Kill these. We only support pkg-config now.
Diffstat (limited to 'libsoup/soup-misc.c')
-rw-r--r--libsoup/soup-misc.c70
1 files changed, 62 insertions, 8 deletions
diff --git a/libsoup/soup-misc.c b/libsoup/soup-misc.c
index 1310fe5c..aa7765c4 100644
--- a/libsoup/soup-misc.c
+++ b/libsoup/soup-misc.c
@@ -687,6 +687,11 @@ soup_shutdown ()
soup_queue_shutdown ();
}
+static char *ssl_ca_file = NULL;
+static char *ssl_ca_dir = NULL;
+static char *ssl_cert_file = NULL;
+static char *ssl_key_file = NULL;
+
/**
* soup_set_ca_file:
* @ca_file: the path to a CA file
@@ -695,9 +700,11 @@ soup_shutdown ()
* peers.
*/
void
-soup_set_ssl_ca_file (gchar *ca_file)
+soup_set_ssl_ca_file (const gchar *ca_file)
{
- putenv (g_strdup_printf ("HTTPS_CA_FILE=%s", ca_file));
+ g_free (ssl_ca_file);
+
+ ssl_ca_file = g_strdup (ca_file);
}
/**
@@ -708,9 +715,11 @@ soup_set_ssl_ca_file (gchar *ca_file)
* peers.
*/
void
-soup_set_ssl_ca_dir (gchar *ca_dir)
+soup_set_ssl_ca_dir (const gchar *ca_dir)
{
- putenv (g_strdup_printf ("HTTPS_CA_DIR=%s", ca_dir));
+ g_free (ssl_ca_dir);
+
+ ssl_ca_dir = g_strdup (ca_dir);
}
/**
@@ -719,13 +728,58 @@ soup_set_ssl_ca_dir (gchar *ca_dir)
* @key_file: the file containing the SSL private key
*
* Specify a SSL client certificate to be used for client
- * authentication with the SOAP server
+ * authentication with the HTTP server
*/
void
-soup_set_ssl_cert_files (gchar *cert_file, gchar *key_file)
+soup_set_ssl_cert_files (const gchar *cert_file, const gchar *key_file)
{
- putenv (g_strdup_printf ("HTTPS_CERT_FILE=%s", cert_file));
- putenv (g_strdup_printf ("HTTPS_KEY_FILE=%s", key_file));
+ g_free (ssl_cert_file);
+ g_free (ssl_key_file);
+
+ ssl_cert_file = g_strdup (cert_file);
+ ssl_key_file = g_strdup (key_file);
+}
+
+/**
+ * soup_get_ca_file:
+ *
+ * Return value: A file containing CA certificates to be used to verify
+ * peers.
+ */
+const char *
+soup_get_ssl_ca_file (void)
+{
+ return ssl_ca_file;
+}
+
+/**
+ * soup_get_ca_dir
+ *
+ * Return value: A directory containing CA certificates to be used to verify
+ * peers.
+ */
+const char *
+soup_get_ssl_ca_dir (void)
+{
+ return ssl_ca_dir;
+}
+
+/**
+ * soup_get_ssl_cert_files
+ * @cert_file: the file containing the SSL client certificate
+ * @key_file: the file containing the SSL private key
+ *
+ * Specify a SSL client certificate to be used for client
+ * authentication with the HTTP server
+ */
+void
+soup_get_ssl_cert_files (const gchar **cert_file, const gchar **key_file)
+{
+ if (cert_file)
+ *cert_file = ssl_cert_file;
+
+ if (key_file)
+ *key_file = ssl_key_file;
}
SoupAuthorizeFn soup_auth_fn = NULL;