diff Core/HttpServer/MongooseServer.h @ 23:62bd05fe4b7c

support for ssl
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 Aug 2012 10:18:34 +0200
parents 3959d33612cc
children 166664f0f860
line wrap: on
line diff
--- a/Core/HttpServer/MongooseServer.h	Mon Aug 27 11:45:53 2012 +0200
+++ b/Core/HttpServer/MongooseServer.h	Tue Aug 28 10:18:34 2012 +0200
@@ -23,6 +23,7 @@
 #include "HttpHandler.h"
 
 #include <list>
+#include <map>
 #include <stdint.h>
 #include <boost/shared_ptr.hpp>
 
@@ -40,6 +41,11 @@
     typedef std::list<HttpHandler*> Handlers;
     Handlers handlers_;
 
+    typedef std::map<std::string, std::string> RegisteredUsers;
+    RegisteredUsers registeredUsers_;
+
+    bool ssl_;
+    std::string certificate_;
     uint16_t port_;
   
     bool IsRunning() const;
@@ -60,8 +66,25 @@
 
     void Stop();
 
+    void RegisterUser(const char* username,
+                      const char* password);
+
     void RegisterHandler(HttpHandler* handler);  // This takes the ownership
 
+    bool IsSslEnabled() const
+    {
+      return ssl_;
+    }
+
+    void SetSslEnabled(bool enabled);
+
+    const std::string& GetSslCertificate() const
+    {
+      return certificate_;
+    }
+
+    void SetSslCertificate(const char* path);
+
     void ClearHandlers();
 
     // Can return NULL if no handler is associated to this URI