[no subject]
- From: Bernhard Schuster <schuster bernhard googlemail com>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>, gtk-list gnome org
- Subject:
- Date: Thu, 17 Oct 2013 19:02:01 +0200
How to implement a tls/ssl based client with a server side cert? The
documentation on that topic is not helpful/confusing (thus posting to both
lists).
** (democlient:405): WARNING **: 1 Error 1 - Error performing TLS
handshake: An unexpected TLS packet was received.
Can somebody please have a look at the below chunk, as the documentation is
not really verbose about how to implement it. I also tried a
GTlsClientConnection based implementation, but the issue reamins (very same
error). The code below is loosly based on one of the test cases of
glib-networking.
Thanks a lot in adavance!
socketclient = g_socket_client_new ();
g_socket_client_set_tls (socketclient, TRUE);
g_socket_client_set_tls_validation_flags (socketclient,
G_TLS_CERTIFICATE_GENERIC_ERROR);
con = g_socket_client_connect_to_host (socketclient,
"127.0.0.1",
1234,
NULL,
&error);
if (error) {
g_warning ("1 Error %i - %s", error->code, error->message);
g_error_free (error);
return EXIT_FAILURE;
}
GIOStream *tlscon = g_tcp_wrapper_connection_get_base_io_stream
(G_TCP_WRAPPER_CONNECTION (con));
// do some IO stuff
Bernhard
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]