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
34
ixwebsocket/IXSocketTLSOptions.cpp
Normal file
34
ixwebsocket/IXSocketTLSOptions.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* IXSocketTLSOptions.h
|
||||
* Author: Benjamin Sergeant
|
||||
* Copyright (c) 2017-2018 Machine Zone, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include "IXSocketTLSOptions.h"
|
||||
|
||||
namespace ix
|
||||
{
|
||||
|
||||
SocketTLSOptions::SocketTLSOptions() {
|
||||
#ifndef IXWEBSOCKET_USE_TLS
|
||||
assert(false && "To use TLS features the library must be compiled with USE_TLS");
|
||||
#endif
|
||||
}
|
||||
|
||||
bool SocketTLSOptions::isUsingClientCert() const
|
||||
{
|
||||
return !certFile.empty() && !keyFile.empty();
|
||||
}
|
||||
|
||||
bool SocketTLSOptions::isUsingSystemDefaults() const
|
||||
{
|
||||
return caFile == "SYSTEM";
|
||||
}
|
||||
|
||||
bool SocketTLSOptions::isPeerVerifyDisabled() const
|
||||
{
|
||||
return caFile != "NONE";
|
||||
}
|
||||
|
||||
} // namespace ix
|
Reference in New Issue
Block a user