'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46'
]
+# TIZEN dlog
+if get_option('tizen_debug')
+ debug_dep = dependency('dlog')
+ config_h.set('TIZEN_DEBUG', get_option('tizen_debug'))
+endif
+
add_project_arguments(common_flags, language: 'c')
symbol_map = join_paths(meson.current_source_dir(), meson.project_name() + '.map')
output += ' GNOME proxy support: ' + gsettings_desktop_schemas_dep.found().to_string() + '\n'
output += ' TIZEN default CA file: ' + get_option('default_ca_file') + '\n'
output += ' TIZEN extension: ' + get_option('tizen_ext').to_string() + '\n'
+output += ' TIZEN debug: ' + get_option('tizen_debug').to_string() + '\n'
message(output)
option('static_modules', type: 'boolean', value: false, description: 'build static modules')
option('default_ca_file', type: 'string', value: '', description: 'set default CA file')
option('tizen_ext', type: 'boolean', value: false, description: 'enable TIZEN extension')
+option('tizen_debug', type: 'boolean', value: false, description: 'enable TIZEN debug')
cp %{SOURCE1001} .
%build
-meson --prefix /usr/ --libdir %{_libdir} build -Dstatic_modules=false -Dgnutls=disabled -Dopenssl=enabled -Ddefault_ca_file=%{TZ_SYS_RO_CA_BUNDLE} -Dtizen_ext=true
+meson --prefix /usr/ --libdir %{_libdir} build \
+ -Dstatic_modules=false \
+ -Dgnutls=disabled \
+ -Dopenssl=enabled \
+ -Ddefault_ca_file=%{TZ_SYS_RO_CA_BUNDLE} \
+ -Dtizen_ext=true \
+ -Dtizen_debug=true
ninja -C build all
%install
static void
gtls_log_func (int level, const char *msg)
{
-#if ENABLE(TIZEN_DLOG)
- TIZEN_LOGI("GTLS: %s", msg);
-#else
g_print ("GTLS: %s", msg);
-#endif
}
#endif
/* FIXME: check sRVName and uniformResourceIdentifier
* subjectAltNames, if appropriate for @identity.
*/
-#if ENABLE(TIZEN_DLOG)
- TIZEN_LOGI("[Network] SSL HandShake - Bad Identity");
-#endif
-
return G_TLS_CERTIFICATE_BAD_IDENTITY;
}
database = g_tls_connection_get_database (conn);
if (database == NULL)
{
-
-#if ENABLE(TIZEN_DLOG)
- TIZEN_LOGI("[Network] SSL HandShake - Unknown CA");
-#endif
-
errors |= G_TLS_CERTIFICATE_UNKNOWN_CA;
errors |= g_tls_certificate_verify (peer_certificate, peer_identity, NULL);
}
/* FIXME: check sRVName and uniformResourceIdentifier
* subjectAltNames, if appropriate for @identity.
*/
-
+ TIZEN_LOGE("SSL HandShake - Bad Identity");
return G_TLS_CERTIFICATE_BAD_IDENTITY;
}
priv = g_tls_client_connection_openssl_get_instance_private (client);
+ TIZEN_LOGI("ssl[%p] client[%p] tls[%p] openssl[%p] priv[%p] data_index[%d]",
+ ssl, client, tls, openssl, priv, data_index);
+
tls->certificate_requested = TRUE;
priv->ca_list = SSL_get_client_CA_list (priv->ssl);
client = SSL_get_ex_data (ssl, data_index);
priv = g_tls_client_connection_openssl_get_instance_private (client);
+ TIZEN_LOGI("ssl[%p] client[%p] priv[%p] data_index[%d]",
+ ssl, client, priv, data_index);
+
len = MIN (*id_len, g_bytes_get_size (priv->session_id));
memcpy (id, g_bytes_get_data (priv->session_id, NULL), len);
if (data_index == -1) {
data_index = SSL_get_ex_new_index (0, (void *)"gtlsclientconnection", NULL, NULL, NULL);
+ TIZEN_LOGI("new data_index[%d]", data_index);
+ } else {
+ TIZEN_LOGI("data_index[%d] is already exist", data_index);
}
SSL_set_ex_data (priv->ssl, data_index, client);
+ TIZEN_LOGI("[SSL] set extra data: priv->ssl[%p] data_index[%d] client[%p]", priv->ssl, data_index, client);
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
if (hostname)
database = g_tls_connection_get_database (conn);
if (database == NULL)
{
+ TIZEN_LOGE("SSL HandShake - Unknown CA");
errors |= G_TLS_CERTIFICATE_UNKNOWN_CA;
errors |= g_tls_certificate_verify (peer_certificate, peer_identity, NULL);
}
ssl = g_tls_connection_openssl_get_ssl (openssl);
+ TIZEN_LOGI("tls[%p] openssl[%p] priv[%p] ssl[%p]", tls, openssl, priv, ssl);
+
BEGIN_OPENSSL_IO (openssl, G_IO_IN | G_IO_OUT, TRUE, cancellable);
ret = SSL_do_handshake (ssl);
END_OPENSSL_IO (openssl, G_IO_IN | G_IO_OUT, ret, status,
priv = g_tls_connection_openssl_get_instance_private (openssl);
+ TIZEN_LOGI("tls[%p] openssl[%p] priv[%p]", tls, openssl, priv);
+
peer_certificate = priv->peer_certificate_tmp;
priv->peer_certificate_tmp = NULL;
peer_certificate_errors = priv->peer_certificate_errors_tmp;
ssl = g_tls_connection_openssl_get_ssl (openssl);
priv = g_tls_connection_openssl_get_instance_private (openssl);
+ TIZEN_LOGI("tls[%p] openssl[%p] priv[%p] ssl[%p]", tls, openssl, priv, ssl);
+
priv->shutting_down = TRUE;
BEGIN_OPENSSL_IO (openssl, G_IO_IN | G_IO_OUT, TRUE, cancellable);
openssl_dep,
]
+if get_option('tizen_debug')
+ deps += [debug_dep]
+endif
+
module = shared_module(
'gioopenssl',
sources: sources,
#include "glib.h"
+#ifdef TIZEN_DEBUG
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "glib-networking"
+#define TIZEN_LOGD(foramt, args...) LOGD(format, ##args)
+#define TIZEN_LOGI(format, args...) LOGI(format, ##args)
+#define TIZEN_LOGE(format, args...) LOGE(format, ##args)
+#else
+#define TIZEN_LOGD(foramt, args...)
+#define TIZEN_LOGI(format, args...)
+#define TIZEN_LOGE(format, args...)
+#endif
+
#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>