summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/hce.c
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-01-29 14:23:32 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-01-29 14:23:32 +0000
commit06d15a1620bd5274567e1bad0e2be7623e5e5fc9 (patch)
treed52dd07d1c89b6a17880e57fb2cf113fd1b9d3d2 /usr.sbin/relayd/hce.c
parent6306aef59f4a6f6202699665489bfeb95ff5c51c (diff)
Add SSL support to hoststated.
with help and OK reyk@ with help and advice by claudio@ and Srebrenko Sehic
Diffstat (limited to 'usr.sbin/relayd/hce.c')
-rw-r--r--usr.sbin/relayd/hce.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/relayd/hce.c b/usr.sbin/relayd/hce.c
index aceef6f8e88..ac887311164 100644
--- a/usr.sbin/relayd/hce.c
+++ b/usr.sbin/relayd/hce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hce.c,v 1.11 2007/01/24 10:26:00 claudio Exp $ */
+/* $OpenBSD: hce.c,v 1.12 2007/01/29 14:23:31 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -36,6 +36,8 @@
#include <err.h>
#include <pwd.h>
+#include <openssl/ssl.h>
+
#include "hoststated.h"
void hce_sig_handler(int sig, short, void *);
@@ -70,6 +72,7 @@ hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2],
struct timeval tv;
struct event ev_sigint;
struct event ev_sigterm;
+ struct table *table;
switch (pid = fork()) {
case -1:
@@ -135,6 +138,15 @@ hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2],
bzero(&tv, sizeof(tv));
evtimer_add(&env->ev, &tv);
+ if (env->flags & F_SSL) {
+ ssl_init(env);
+ TAILQ_FOREACH(table, &env->tables, entry) {
+ if (!(table->flags & F_SSL))
+ continue;
+ table->ssl_ctx = ssl_ctx_create(env);
+ }
+ }
+
event_dispatch();
hce_shutdown();