/* */ #ifndef D_LIBSSL_TLS_CONTEXT_H #define D_LIBSSL_TLS_CONTEXT_H #include "common.h" #include # include #include "TLSContext.h" #include "DlAbortEx.h" namespace aria2 { class OpenSSLTLSContext : public TLSContext { public: OpenSSLTLSContext(TLSSessionSide side); ~OpenSSLTLSContext(); // private key `keyfile' must be decrypted. virtual bool addCredentialFile(const std::string& certfile, const std::string& keyfile); virtual bool addSystemTrustedCACerts(); // certfile can contain multiple certificates. virtual bool addTrustedCACertFile(const std::string& certfile); virtual bool good() const; virtual TLSSessionSide getSide() const { return side_; } virtual bool getVerifyPeer() const { return verifyPeer_; } virtual void setVerifyPeer(bool verify) { verifyPeer_ = verify; } SSL_CTX* getSSLCtx() const { return sslCtx_; } private: SSL_CTX* sslCtx_; TLSSessionSide side_; bool good_; bool verifyPeer_; }; } // namespace aria2 #endif // D_LIBSSL_TLS_CONTEXT_H