/* */ #ifndef LIBSSL_TLS_SESSION_H #define LIBSSL_TLS_SESSION_H #include "common.h" #include #include "LibsslTLSContext.h" #include "TLSSession.h" #include "a2netcompat.h" namespace aria2 { class OpenSSLTLSSession : public TLSSession { public: OpenSSLTLSSession(OpenSSLTLSContext* tlsContext); virtual ~OpenSSLTLSSession(); virtual int init(sock_t sockfd); virtual int setSNIHostname(const std::string& hostname); virtual int closeConnection(); virtual int checkDirection(); virtual ssize_t writeData(const void* data, size_t len); virtual ssize_t readData(void* data, size_t len); virtual int tlsConnect(const std::string& hostname, std::string& handshakeErr); virtual int tlsAccept(); virtual std::string getLastErrorString(); private: int handshake(); SSL* ssl_; OpenSSLTLSContext* tlsContext_; // Last error code from openSSL library functions int rv_; }; } // namespace aria2 #endif // LIBSSL_TLS_SESSION_H