/* */ #ifndef D_LIBGNUTLS_TLS_CONTEXT_H #define D_LIBGNUTLS_TLS_CONTEXT_H #include "common.h" #include #include "TLSContext.h" #include "DlAbortEx.h" namespace aria2 { class GnuTLSContext : public TLSContext { public: GnuTLSContext(TLSSessionSide side); virtual ~GnuTLSContext(); // 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; } gnutls_certificate_credentials_t getCertCred() const; private: gnutls_certificate_credentials_t certCred_; TLSSessionSide side_; bool good_; bool verifyPeer_; }; } // namespace aria2 #endif // D_LIBGNUTLS_TLS_CONTEXT_H