Auto-TLS support.

This commit is contained in:
JoelKatz
2013-01-24 15:53:52 -08:00
parent bc07943e79
commit 96e2e7497e
2 changed files with 8 additions and 9 deletions

View File

@@ -12,7 +12,7 @@
namespace websocketpp
{
class server;
class server_tls;
class server_autotls;
}
#endif
@@ -20,19 +20,18 @@ namespace websocketpp
class WSDoor
{
private:
websocketpp::server* mEndpoint;
websocketpp::server_tls* mSEndpoint;
websocketpp::server_autotls* mSEndpoint;
boost::thread* mThread;
bool mPublic;
std::string mIp;
int mPort;
boost::thread* mThread;
bool mPublic;
std::string mIp;
int mPort;
void startListening();
public:
WSDoor(const std::string& strIp, int iPort, bool bPublic) : mEndpoint(0), mSEndpoint(0), mThread(0), mPublic(bPublic), mIp(strIp), mPort(iPort) { ; }
WSDoor(const std::string& strIp, int iPort, bool bPublic) : mSEndpoint(0), mThread(0), mPublic(bPublic), mIp(strIp), mPort(iPort) { ; }
void stop();

View File

@@ -37,7 +37,7 @@ protected:
public:
WSServerHandler(boost::shared_ptr<boost::asio::ssl::context> spCtx, bool bPublic) : mCtx(spCtx), mPublic(bPublic)
{
if (theConfig.WEBSOCKET_SECURE)
if (theConfig.WEBSOCKET_SECURE != 0)
{
initSSLContext(*mCtx, theConfig.WEBSOCKET_SSL_KEY,
theConfig.WEBSOCKET_SSL_CERT, theConfig.WEBSOCKET_SSL_CHAIN);