IXWebSocket/ixwebsocket/IXSocketTLSOptions.cpp

36 lines
724 B
C++
Raw Normal View History

/*
* IXSocketTLSOptions.h
* Author: Benjamin Sergeant
* Copyright (c) 2017-2018 Machine Zone, Inc. All rights reserved.
*/
#include "IXSocketTLSOptions.h"
2019-09-23 19:25:23 +02:00
#include <assert.h>
namespace ix
{
2019-09-23 19:25:23 +02:00
SocketTLSOptions::SocketTLSOptions()
{
#ifndef IXWEBSOCKET_USE_TLS
assert(false && "To use TLS features the library must be compiled with USE_TLS");
2019-09-23 19:25:23 +02:00
#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