make TLS support optional

This commit is contained in:
Benjamin Sergeant
2018-10-08 15:23:01 -07:00
parent 1dc9b559e9
commit 88c2e1f6de
7 changed files with 129 additions and 9 deletions

View File

@ -11,10 +11,12 @@
#include "IXWebSocketTransport.h"
#include "IXSocket.h"
#ifdef __APPLE__
# include "IXSocketAppleSSL.h"
#else
# include "IXSocketOpenSSL.h"
#ifdef IXWEBSOCKET_USE_TLS
# ifdef __APPLE__
# include "IXSocketAppleSSL.h"
# else
# include "IXSocketOpenSSL.h"
# endif
#endif
#include <unistd.h>
@ -140,10 +142,14 @@ namespace ix {
if (protocol == "wss")
{
_socket.reset();
#ifdef __APPLE__
_socket = std::make_shared<SocketAppleSSL>();
#ifdef IXWEBSOCKET_USE_TLS
# ifdef __APPLE__
_socket = std::make_shared<SocketAppleSSL>();
# else
_socket = std::make_shared<SocketOpenSSL>();
# endif
#else
_socket = std::make_shared<SocketOpenSSL>();
return WebSocketInitResult(false, 0, "TLS is not supported.");
#endif
}
else