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