proxygen
wangle::SSLContextConfig Struct Reference

#include <SSLContextConfig.h>

Classes

struct  CertificateInfo
 
struct  KeyOffloadParams
 

Public Types

typedef std::function< bool(char const *server_name)> SNINoMatchFn
 

Public Member Functions

 SSLContextConfig ()=default
 
 ~SSLContextConfig ()=default
 
void setCertificate (const std::string &certPath, const std::string &keyPath, const std::string &passwordPath)
 
void addCertificate (const std::string &certPath, const std::string &keyPath, const std::string &passwordPath)
 
void setNextProtocols (const std::list< std::string > &inNextProtocols)
 

Static Public Member Functions

static const std::stringgetDefaultCiphers ()
 

Public Attributes

std::vector< CertificateInfocertificates
 
folly::SSLContext::SSLVersion sslVersion
 
bool sessionCacheEnabled {true}
 
bool sessionTicketEnabled {true}
 
bool clientHelloParsingEnabled {true}
 
std::string sslCiphers {getDefaultCiphers()}
 
std::string eccCurveName {"prime256v1"}
 
std::list< folly::SSLContext::NextProtocolsItemnextProtocols
 
bool isLocalPrivateKey {true}
 
bool isDefault {false}
 
SNINoMatchFn sniNoMatchFn
 
std::string clientCAFile
 
folly::SSLContext::SSLVerifyPeerEnum clientVerification
 
KeyOffloadParams keyOffloadParams
 
folly::Optional< std::stringsessionContext
 

Detailed Description

Definition at line 38 of file SSLContextConfig.h.

Member Typedef Documentation

typedef std::function<bool(char const* server_name)> wangle::SSLContextConfig::SNINoMatchFn

Definition at line 96 of file SSLContextConfig.h.

Constructor & Destructor Documentation

wangle::SSLContextConfig::SSLContextConfig ( )
default
wangle::SSLContextConfig::~SSLContextConfig ( )
default

Member Function Documentation

void wangle::SSLContextConfig::addCertificate ( const std::string certPath,
const std::string keyPath,
const std::string passwordPath 
)
inline

Definition at line 81 of file SSLContextConfig.h.

References certificates.

Referenced by main(), setCertificate(), and wangle::TEST().

83  {
84  certificates.emplace_back(certPath, keyPath, passwordPath);
85  }
std::vector< CertificateInfo > certificates
static const std::string& wangle::SSLContextConfig::getDefaultCiphers ( )
inlinestatic

Definition at line 52 of file SSLContextConfig.h.

References folly::join(), folly::ssl::SSLServerOptions::kCipherList, and string.

52  {
53  static const std::string& defaultCiphers =
55  return defaultCiphers;
56  }
static constexpr auto kCipherList
Definition: SSLOptions.h:76
const char * string
Definition: Conv.cpp:212
void join(const Delim &delimiter, Iterator begin, Iterator end, String &output)
Definition: String-inl.h:498
void wangle::SSLContextConfig::setCertificate ( const std::string certPath,
const std::string keyPath,
const std::string passwordPath 
)
inline

Helpers to set/add a certificate

Definition at line 74 of file SSLContextConfig.h.

References addCertificate(), and certificates.

Referenced by setupServer(), TEST(), and TEST_F().

76  {
77  certificates.clear();
78  addCertificate(certPath, keyPath, passwordPath);
79  }
std::vector< CertificateInfo > certificates
void addCertificate(const std::string &certPath, const std::string &keyPath, const std::string &passwordPath)
void wangle::SSLContextConfig::setNextProtocols ( const std::list< std::string > &  inNextProtocols)
inline

Set the optional list of protocols to advertise via TLS Next Protocol Negotiation. An empty list means NPN is not enabled.

Definition at line 91 of file SSLContextConfig.h.

References nextProtocols.

91  {
92  nextProtocols.clear();
93  nextProtocols.emplace_back(1, inNextProtocols);
94  }
std::list< folly::SSLContext::NextProtocolsItem > nextProtocols

Member Data Documentation

std::vector<CertificateInfo> wangle::SSLContextConfig::certificates
std::string wangle::SSLContextConfig::clientCAFile
bool wangle::SSLContextConfig::clientHelloParsingEnabled {true}

Definition at line 103 of file SSLContextConfig.h.

folly::SSLContext::SSLVerifyPeerEnum wangle::SSLContextConfig::clientVerification
Initial value:
{
folly::SSLContext::SSLVerifyPeerEnum::VERIFY_REQ_CLIENT_CERT}

Definition at line 119 of file SSLContextConfig.h.

Referenced by wangle::SSLContextManager::addSSLContextConfig(), and TEST_F().

std::string wangle::SSLContextConfig::eccCurveName {"prime256v1"}

Definition at line 105 of file SSLContextConfig.h.

Referenced by wangle::SSLContextManager::addSSLContextConfig().

bool wangle::SSLContextConfig::isDefault {false}
bool wangle::SSLContextConfig::isLocalPrivateKey {true}

Definition at line 110 of file SSLContextConfig.h.

KeyOffloadParams wangle::SSLContextConfig::keyOffloadParams

Definition at line 122 of file SSLContextConfig.h.

Referenced by wangle::SSLContextManager::addSSLContextConfig().

std::list<folly::SSLContext::NextProtocolsItem> wangle::SSLContextConfig::nextProtocols
bool wangle::SSLContextConfig::sessionCacheEnabled {true}
folly::Optional<std::string> wangle::SSLContextConfig::sessionContext
bool wangle::SSLContextConfig::sessionTicketEnabled {true}

Definition at line 102 of file SSLContextConfig.h.

Referenced by wangle::ServerSSLContext::setupTicketManager().

SNINoMatchFn wangle::SSLContextConfig::sniNoMatchFn
std::string wangle::SSLContextConfig::sslCiphers {getDefaultCiphers()}

Definition at line 104 of file SSLContextConfig.h.

Referenced by wangle::SSLContextManager::addSSLContextConfig().

folly::SSLContext::SSLVersion wangle::SSLContextConfig::sslVersion
Initial value:

Definition at line 99 of file SSLContextConfig.h.

Referenced by wangle::SSLContextManager::addSSLContextConfig().


The documentation for this struct was generated from the following file: