summaryrefslogtreecommitdiff
path: root/lib/event.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2013-02-11 16:41:47 +0100
committerLinus Nordberg <linus@nordberg.se>2013-02-11 16:41:47 +0100
commitd640207c74e0aaf5b4a3faf61c38e17796bf76a2 (patch)
treed79a0eabf66503525f4bf1a3495e00ed50f7d207 /lib/event.c
parent8d113bba795b1b8cf4ab55b362108f2c819e039d (diff)
Add support for configuring client connections too.
We're moving x509 and psk config from rs_realm to rs_peer while allowing these to be configured on the realm level and overriden at peer level. Also, add support for printing the read configuration, for debugging.
Diffstat (limited to 'lib/event.c')
-rw-r--r--lib/event.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/event.c b/lib/event.c
index 138fa72..6b7ba48 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -244,11 +244,12 @@ int
event_on_connect (struct rs_connection *conn, struct rs_message *msg)
{
assert (!conn->is_connecting);
+ assert (conn->active_peer);
#if defined (RS_ENABLE_TLS)
if ((conn->realm->type == RS_CONN_TYPE_TLS
|| conn->realm->type == RS_CONN_TYPE_DTLS)
- && conn->realm->transport_cred->type != RS_CRED_TLS_PSK)
+ && conn->active_peer->transport_cred->type != RS_CRED_TLS_PSK)
if (tls_verify_cert (conn) != RSE_OK)
{
rs_debug (("%s: server cert verification failed\n", __func__));