comparison PalantirServer/main.cpp @ 23:62bd05fe4b7c

support for ssl
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 Aug 2012 10:18:34 +0200
parents e85455ff6039
children dd1489098265
comparison
equal deleted inserted replaced
22:1bc6327d1de3 23:62bd05fe4b7c
121 121
122 // HTTP server 122 // HTTP server
123 MongooseServer httpServer; 123 MongooseServer httpServer;
124 httpServer.SetPort(GetGlobalIntegerParameter("HttpPort", 8000)); 124 httpServer.SetPort(GetGlobalIntegerParameter("HttpPort", 8000));
125 125
126 if (GetGlobalBoolParameter("SslEnabled", false))
127 {
128 std::string certificate = GetGlobalStringParameter("SslCertificate", "certificate.pem");
129 httpServer.SetSslEnabled(true);
130 httpServer.SetSslCertificate(certificate.c_str());
131 }
132 else
133 {
134 httpServer.SetSslEnabled(false);
135 }
136
126 #if PALANTIR_STANDALONE == 1 137 #if PALANTIR_STANDALONE == 1
127 httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::PALANTIR_EXPLORER)); 138 httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::PALANTIR_EXPLORER));
128 #else 139 #else
129 httpServer.RegisterHandler(new FilesystemHttpHandler("/app", PALANTIR_PATH "/PalantirExplorer")); 140 httpServer.RegisterHandler(new FilesystemHttpHandler("/app", PALANTIR_PATH "/PalantirExplorer"));
130 #endif 141 #endif