Add new build option to use tizen default CA file 78/202978/1 accepted/tizen/unified/20190408.233912 submit/tizen/20190408.102431
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 8 Apr 2019 08:48:58 +0000 (17:48 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 8 Apr 2019 08:49:04 +0000 (17:49 +0900)
Change-Id: Ibaae24649b67bf19f3481b2339f8224d377e729e

meson.build
meson_options.txt
packaging/glib-networking.spec
tls/openssl/gtlsbackend-openssl.c

index 4feb280..705b30d 100644 (file)
@@ -22,6 +22,11 @@ config_h = configuration_data()
 
 config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
 
+# Update default CA file
+if get_option('default_ca_file') != ''
+  config_h.set_quoted('TIZEN_DEFAULT_CA_FILE', get_option('default_ca_file'))
+endif
+
 # compiler flags
 common_flags = [
   '-DHAVE_CONFIG_H',
@@ -194,4 +199,5 @@ output += '  gnutls support:      ' + backends.contains('gnutls').to_string() +
 output += '  openssl support:     ' + backends.contains('openssl').to_string() + '\n'
 output += '  libproxy support:    ' + libproxy_dep.found().to_string() + '\n'
 output += '  GNOME proxy support: ' + gsettings_desktop_schemas_dep.found().to_string() + '\n'
+output += '  TIZEN default CA file: ' + get_option('default_ca_file') + '\n'
 message(output)
index 3a525dd..dab9617 100644 (file)
@@ -4,3 +4,4 @@ option('libproxy', type: 'feature', value: 'auto', description: 'support for lib
 option('gnome_proxy', type: 'feature', value: 'auto', description: 'support for GNOME desktop proxy configuration')
 option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests')
 option('static_modules', type: 'boolean', value: false, description: 'build static modules')
+option('default_ca_file', type: 'string', value: '', description: 'set default CA file')
index b4239fe..606d5c3 100755 (executable)
@@ -36,7 +36,7 @@ Currently, there is only a proxy module based on libproxy.
 cp %{SOURCE1001} .
 
 %build
-meson --prefix /usr/ build -Dstatic_modules=false -Dgnutls=disabled -Dopenssl=enabled
+meson --prefix /usr/ build -Dstatic_modules=false -Dgnutls=disabled -Dopenssl=enabled -Ddefault_ca_file=%{TZ_SYS_RO_CA_BUNDLE}
 ninja -C build all
 
 %install
index abff7bb..b97c653 100644 (file)
@@ -211,7 +211,11 @@ g_tls_backend_openssl_real_create_database (GTlsBackendOpenssl  *self,
     {
       const gchar *openssl_cert_file;
 
+#ifdef TIZEN_DEFAULT_CA_FILE
+      openssl_cert_file = TIZEN_DEFAULT_CA_FILE;
+#else
       openssl_cert_file = g_getenv (X509_get_default_cert_file_env ());
+#endif
       if (openssl_cert_file == NULL)
         openssl_cert_file = X509_get_default_cert_file ();