WIP: support configurable certificates/keys, and root trust CAs (#114)
* wip: tls options implemented in openssl * update naming, remove #define guard * assert compiled with USE_TLS for tls options * apply autoformatter * include tls options impl * style cleanup; auto ssl_err * ssl_err -> sslErr * be explicit about SSL_VERIFY_NONE
This commit is contained in:
committed by
Benjamin Sergeant
parent
ed4be773a2
commit
408ee41990
@ -32,6 +32,7 @@
|
||||
// Adapted from https://github.com/dhbaird/easywsclient
|
||||
//
|
||||
|
||||
#include "IXSocketTLSOptions.h"
|
||||
#include "IXWebSocketTransport.h"
|
||||
#include "IXWebSocketHandshake.h"
|
||||
#include "IXWebSocketHttpHeaders.h"
|
||||
@ -103,12 +104,14 @@ namespace ix
|
||||
}
|
||||
|
||||
void WebSocketTransport::configure(const WebSocketPerMessageDeflateOptions& perMessageDeflateOptions,
|
||||
const SocketTLSOptions& socketTLSOptions,
|
||||
bool enablePong,
|
||||
int pingIntervalSecs,
|
||||
int pingTimeoutSecs)
|
||||
{
|
||||
_perMessageDeflateOptions = perMessageDeflateOptions;
|
||||
_enablePerMessageDeflate = _perMessageDeflateOptions.enabled();
|
||||
_socketTLSOptions = socketTLSOptions;
|
||||
_enablePong = enablePong;
|
||||
_pingIntervalSecs = pingIntervalSecs;
|
||||
_pingTimeoutSecs = pingTimeoutSecs;
|
||||
@ -147,7 +150,7 @@ namespace ix
|
||||
|
||||
std::string errorMsg;
|
||||
bool tls = protocol == "wss";
|
||||
_socket = createSocket(tls, errorMsg);
|
||||
_socket = createSocket(tls, errorMsg, _socketTLSOptions);
|
||||
|
||||
if (!_socket)
|
||||
{
|
||||
|
Reference in New Issue
Block a user