while (connection == NULL)
{
GSocketAddress *address = NULL;
+ gboolean application_proxy = FALSE;
GSocket *socket;
if (g_cancellable_is_cancelled (cancellable))
g_object_unref (connection);
connection = NULL;
}
+ else
+ {
+ application_proxy = TRUE;
+ }
}
- if (connection && client->priv->tls)
+ if (!application_proxy && connection && client->priv->tls)
{
GIOStream *tlsconn;
enumerator_next_async (data);
}
+ else
+ {
+ /* Simply complete the connection, we don't want to do TLS handshake
+ * as the application proxy handling may need proxy handshake first */
+ g_socket_client_async_connect_complete (data);
+ }
}
static void
* proxy protocols that are reused between protocols. A good example
* is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
* be use as generic socket proxy through the HTTP CONNECT method.
+ *
+ * When the proxy is detected as being an application proxy, TLS handshake
+ * will be skipped. This is required to let the application do the proxy
+ * specific handshake.
*/
void
g_socket_client_add_application_proxy (GSocketClient *client,