src/server/daemon/httplistener.h

changeset 106
b122f34ddc80
parent 74
5bc6d078fb2c
child 130
198ad9d8cec1
--- a/src/server/daemon/httplistener.h	Wed Oct 28 17:59:34 2015 +0100
+++ b/src/server/daemon/httplistener.h	Sat Oct 31 15:01:07 2015 +0100
@@ -32,6 +32,11 @@
 #include "sessionhandler.h"
 #include "threadpools.h"
 #include "config.h"
+#include "../util/systems.h"
+
+#include <openssl/bio.h> 
+#include <openssl/ssl.h> 
+#include <openssl/err.h> 
 
 #ifdef	__cplusplus
 extern "C" {
@@ -40,6 +45,9 @@
 /* HttpListener typedef in nsapi.h */
 typedef struct _acceptor         Acceptor;
 typedef struct _listener_config  ListenerConfig;
+typedef struct _http_ssl         HttpSSL;
+
+
 
 
 union vs {
@@ -54,6 +62,10 @@
     char                 *address;
     int                  port;
     int                  nacceptors;
+    WSBool               ssl;
+    sstr_t               certfile;
+    sstr_t               privkeyfile;
+    sstr_t               chainfile;
 };
 
 struct _acceptor {
@@ -73,9 +85,23 @@
     Acceptor             **acceptors;
     int                  nacceptors;
     int                  running;
+    HttpSSL              *ssl;
     uint32_t             ref; // reference counter
 };
 
+struct _http_ssl {
+    unsigned char *cert;
+    size_t        certlen;
+    unsigned char *privkey;
+    size_t        privkeylen;
+    unsigned char *chain;
+    size_t        chainlen;
+    
+    SSL_CTX       *sslctx;
+    
+    // TODO: ssl/tls cipher, ... config
+};
+
 int start_all_listener();
 
 HttpListener* http_listener_create(ListenerConfig *conf);

mercurial