summaryrefslogtreecommitdiff
path: root/lib/tcp.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2012-04-26 10:19:52 +0200
committerLinus Nordberg <linus@nordu.net>2012-04-26 10:19:52 +0200
commitc562df4b073a288862dd3c4ceaba7d6439f33b45 (patch)
tree4641c6f6d69314508b2455ac9cb5fdaa31c8d296 /lib/tcp.c
parent6e6672cffd42def79813dbf7f1588d2ce219ca79 (diff)
Verify certificate CN against configured hostname.
NOTE: The subjectAltName check is not well tested.
Diffstat (limited to 'lib/tcp.c')
-rw-r--r--lib/tcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tcp.c b/lib/tcp.c
index f98e971..c4948c0 100644
--- a/lib/tcp.c
+++ b/lib/tcp.c
@@ -179,7 +179,11 @@ tcp_event_cb (struct bufferevent *bev, short events, void *user_data)
{
if (conn->tev)
evtimer_del (conn->tev); /* Cancel connect timer. */
- event_on_connect (conn, pkt);
+ if (event_on_connect (conn, pkt))
+ {
+ event_on_disconnect (conn);
+ event_loopbreak (conn);
+ }
}
else if (events & BEV_EVENT_EOF)
{