{
return hc_conn_set_driver_ssl (conn, lowconn, 1);
}
+
+void
+hc_conn_ssl_server_set_priority (HCConn *conn, char *priority)
+{
+ struct ssl_data *ssl;
+ ssl = conn->layer;
+ gnutls_priority_set_direct (ssl->session, priority, NULL);
+}
int hc_conn_set_driver_ssl_client (HCConn *, HCConn *);
int hc_conn_set_driver_ssl_server (HCConn *, HCConn *);
void * hc_conn_ssl_server_init_credentials (char *, char *);
+void hc_conn_ssl_server_set_priority (HCConn *, char *);
#endif
char *server;
char *port;
int ssl;
+ char *priority;
};
static HCConn *
}
static HCConn *
-client_conn_new (int fd)
+client_conn_new (int fd, struct pop_address *address)
{
HCConn *conn;
HCConn *ssl_conn;
close (fd);
return NULL;
}
+
ssl_conn = hc_conn_new (NULL, NULL);
hc_conn_set_driver_ssl_server (ssl_conn, conn);
+ if (address && address->priority)
+ hc_conn_ssl_server_set_priority (ssl_conn, address->priority);
+
if (r != 0)
{
hc_conn_close (ssl_conn);
g_message ("Received connection from %s.",
inet_ntoa (((struct sockaddr_in *) addr)->sin_addr));
- client_conn = client_conn_new (fd);
+ client_conn = client_conn_new (fd, address);
if (client_conn == NULL)
{
return;
gchar *server_address;
gchar *server_port;
int server_ssl;
+ gchar *server_priority;
gchar *certfile;
gchar *ssl_keyfile;
gchar *policy;
server_ssl = 0;
g_error_free (error);
}
+ error = NULL;
+ server_priority = g_key_file_get_string (keyfile, "global", "priority",
+ &error);
+ if (server_priority == NULL && error != NULL)
+ {
+ server_priority = g_strdup ("NORMAL");
+ g_error_free (error);
+ }
error = NULL;
policy = g_key_file_get_string (keyfile, "global", "policy",
pop_address.server = server_address;
pop_address.port = server_port;
pop_address.ssl = server_ssl;
+ pop_address.priority = server_priority;
server_fd = hc_tcp_server (port);
if (server_fd < 0)