/* */ #ifndef _D_LIBSSL_TLS_CONTEXT_H_ #define _D_LIBSSL_TLS_CONTEXT_H_ #include "common.h" #include # include #include "DlAbortEx.h" namespace aria2 { class Logger; class TLSContext { private: SSL_CTX* sslCtx_; bool good_; bool peerVerificationEnabled_; Logger* logger_; public: TLSContext(); ~TLSContext(); // private key `keyfile' must be decrypted. bool addClientKeyFile(const std::string& certfile, const std::string& keyfile); // certfile can contain multiple certificates. bool addTrustedCACertFile(const std::string& certfile); bool good() const; bool bad() const; SSL_CTX* getSSLCtx() const { return sslCtx_; } void enablePeerVerification(); void disablePeerVerification(); bool peerVerificationEnabled() const { return peerVerificationEnabled_; } }; } // namespace aria2 #endif // _D_LIBSSL_TLS_CONTEXT_H_