summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-11-01 21:51:12 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-01 21:51:12 +0200
commita05feb005ff3bc56beb704c0b1ed435219ca5876 (patch)
tree969d7c0f796fe88ed12913652010d8829e21e5af
parent660178471d36c4762dc2f70e1cdbcf7c2ddf4c15 (diff)
glib-networking: Use a relative path for the SSL CA certs on Windows too
https://bugzilla.gnome.org/show_bug.cgi?id=771505
-rw-r--r--recipes/glib-networking-static.recipe3
-rw-r--r--recipes/glib-networking.recipe3
-rw-r--r--recipes/glib-networking/0004-gtlsbackend-gnutls-Get-anchor-file-relative-to-libgi.patch51
3 files changed, 55 insertions, 2 deletions
diff --git a/recipes/glib-networking-static.recipe b/recipes/glib-networking-static.recipe
index ffae8a2b..080a877c 100644
--- a/recipes/glib-networking-static.recipe
+++ b/recipes/glib-networking-static.recipe
@@ -16,7 +16,8 @@ class Recipe(recipe.Recipe):
deps = ['glib', 'gnutls', 'glib-networking']
patches = ['glib-networking/0001-Add-support-for-static-modules.patch',
'glib-networking/0002-Get-the-CA-certificate-path-from-the-environment-var.patch',
- 'glib-networking/0003-gnutls-Use-db-relative-to-libglib-2.0-if-needed.patch']
+ 'glib-networking/0003-gnutls-Use-db-relative-to-libglib-2.0-if-needed.patch',
+ 'glib-networking/0004-gtlsbackend-gnutls-Get-anchor-file-relative-to-libgi.patch']
files_devel = ['lib/gio/modules/static/libgiognutls.a',
diff --git a/recipes/glib-networking.recipe b/recipes/glib-networking.recipe
index 83253ccd..33a30777 100644
--- a/recipes/glib-networking.recipe
+++ b/recipes/glib-networking.recipe
@@ -13,7 +13,8 @@ class Recipe(recipe.Recipe):
deps = ['glib', 'gnutls']
patches = ['glib-networking/0001-Add-support-for-static-modules.patch',
'glib-networking/0002-Get-the-CA-certificate-path-from-the-environment-var.patch',
- 'glib-networking/0003-gnutls-Use-db-relative-to-libglib-2.0-if-needed.patch']
+ 'glib-networking/0003-gnutls-Use-db-relative-to-libglib-2.0-if-needed.patch',
+ 'glib-networking/0004-gtlsbackend-gnutls-Get-anchor-file-relative-to-libgi.patch']
files_misc = ['lib/gio/modules/libgiognutls%(mext)s']
files_lang = ['glib-networking']
diff --git a/recipes/glib-networking/0004-gtlsbackend-gnutls-Get-anchor-file-relative-to-libgi.patch b/recipes/glib-networking/0004-gtlsbackend-gnutls-Get-anchor-file-relative-to-libgi.patch
new file mode 100644
index 00000000..51fe63b8
--- /dev/null
+++ b/recipes/glib-networking/0004-gtlsbackend-gnutls-Get-anchor-file-relative-to-libgi.patch
@@ -0,0 +1,51 @@
+From aad2b4a10fc1e21155724c6cc2bd735a589ad626 Mon Sep 17 00:00:00 2001
+From: Sebastian Droege <sebastian@centricular.com>
+Date: Tue, 1 Nov 2016 19:48:12 +0000
+Subject: [PATCH 4/4] gtlsbackend-gnutls: Get anchor file relative to libgio on
+ Windows
+
+---
+ tls/gnutls/gtlsbackend-gnutls.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/tls/gnutls/gtlsbackend-gnutls.c b/tls/gnutls/gtlsbackend-gnutls.c
+index 1cf9127..74c98af 100644
+--- a/tls/gnutls/gtlsbackend-gnutls.c
++++ b/tls/gnutls/gtlsbackend-gnutls.c
+@@ -38,6 +38,10 @@
+ #include <dlfcn.h>
+ #endif
+
++#ifdef G_OS_WIN32
++#include <windows.h>
++#endif
++
+ struct _GTlsBackendGnutlsPrivate
+ {
+ GMutex mutex;
+@@ -154,6 +158,22 @@ g_tls_backend_gnutls_real_create_database (GTlsBackendGnutls *self,
+ }
+ #endif
+
++#ifdef G_OS_WIN32
++ if (!anchor_file || !g_file_test (anchor_file, G_FILE_TEST_IS_REGULAR))
++ {
++ HMODULE module;
++ gchar *module_path;
++ module = GetModuleHandle ("libgio-2.0-0.dll");
++ if (module)
++ {
++ module_path = g_win32_get_package_installation_directory_of_module (module);
++ if (module_path)
++ anchor_file = g_build_filename (module_path, "etc", "ssl", "certs", "ca-certificates.crt", NULL);
++ g_free (module_path);
++ }
++ }
++#endif
++
+ #ifdef GST_CA_CERTIFICATES_FROM_ENV
+ anchor_file = g_getenv ("CA_CERTIFICATES");
+ #endif
+--
+2.6.3.windows.1
+