8#include <openssl/ssl.h>
9#include <openssl/err.h>
45 bool reload(std::string* error =
nullptr);
65 std::shared_ptr<const CertSet>
certs_;
68 std::shared_ptr<const CertSet>
current()
const;
Definition TlsContext.hpp:73
ClientTlsContext & operator=(const ClientTlsContext &)=delete
ClientTlsContext(bool verify_peer=true, const std::string &ca_file="")
SSL_CTX * get() const
Definition TlsContext.hpp:87
ClientTlsContext(const ClientTlsContext &)=delete
SSL_CTX * ctx_
Definition TlsContext.hpp:90
Server TLS settings: certificates (with SNI) and ALPN.
Definition TlsContext.hpp:22
std::shared_ptr< const CertSet > current() const
config::TlsCertificate default_cert_
Definition TlsContext.hpp:61
config::HttpVersion get_http_version() const
Definition TlsContext.hpp:36
TlsContext(const std::string &cert_file, const std::string &key_file, config::HttpVersion http_version)
config::HttpVersion http_version_
Definition TlsContext.hpp:60
TlsContext & operator=(const TlsContext &)=delete
std::string file_stamp() const
TlsContext(const config::TlsCertificate &default_cert, std::vector< config::TlsCertificate > sni_certs, config::HttpVersion http_version)
std::vector< config::TlsCertificate > sni_certs_
Definition TlsContext.hpp:62
SSL_CTX * ctx_
Definition TlsContext.hpp:59
std::mutex mutex_
Definition TlsContext.hpp:64
static int servername_cb(SSL *ssl, int *alert, void *arg)
bool reload(std::string *error=nullptr)
Re-reads every certificate and key file. Thread-safe.
bool files_changed() const
True if a certificate or key file changed since it was last loaded.
TlsContext(const TlsContext &)=delete
std::string stamp_
Definition TlsContext.hpp:66
std::string certificate_for(const std::string &server_name) const
The certificate file that serves server_name (for tests and logs).
std::shared_ptr< const CertSet > certs_
Definition TlsContext.hpp:65
void configure(SSL_CTX *ctx)
Configures a context to match this one (protocol floor, ALPN).
SSL_CTX * get() const
Definition TlsContext.hpp:35
HttpVersion
Definition Config.hpp:18
Definition Http2Session.hpp:21
A PEM certificate chain and its private key.
Definition Config.hpp:25