mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-22 08:02:06 +02:00
#3880: NetSSL_OpenSSL: Support session resumption with TLSv1.3
This commit is contained in:
@@ -287,6 +287,10 @@ protected:
|
||||
/// Returns the index for SSL_CTX_set_ex_data() and SSL_CTX_get_ex_data() to
|
||||
/// store the Context* in the underlying SSL_CTX.
|
||||
|
||||
int socketIndex() const;
|
||||
/// Returns the index for SSL_set_ex_data() and SSL_get_ex_data() to
|
||||
/// store the SecureSocketImpl* in the underlying SSL.
|
||||
|
||||
private:
|
||||
SSLManager();
|
||||
/// Creates the SSLManager.
|
||||
@@ -320,6 +324,7 @@ private:
|
||||
PrivateKeyPassphraseHandlerPtr _ptrClientPassphraseHandler;
|
||||
InvalidCertificateHandlerPtr _ptrClientCertificateHandler;
|
||||
int _contextIndex;
|
||||
int _socketIndex;
|
||||
Poco::FastMutex _mutex;
|
||||
|
||||
static const std::string CFG_PRIV_KEY_FILE;
|
||||
@@ -359,6 +364,7 @@ private:
|
||||
|
||||
friend class Poco::SingletonHolder<SSLManager>;
|
||||
friend class Context;
|
||||
friend class SecureSocketImpl;
|
||||
};
|
||||
|
||||
|
||||
@@ -405,6 +411,12 @@ inline int SSLManager::contextIndex() const
|
||||
}
|
||||
|
||||
|
||||
inline int SSLManager::socketIndex() const
|
||||
{
|
||||
return _socketIndex;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
|
||||
|
@@ -280,6 +280,9 @@ protected:
|
||||
/// Note that simply closing a socket is not sufficient
|
||||
/// to be able to re-use it again.
|
||||
|
||||
static int onSessionCreated(SSL* pSSL, SSL_SESSION* pSession);
|
||||
/// Callback to handle new session data sent by server.
|
||||
|
||||
private:
|
||||
SecureSocketImpl(const SecureSocketImpl&);
|
||||
SecureSocketImpl& operator = (const SecureSocketImpl&);
|
||||
@@ -293,6 +296,7 @@ private:
|
||||
bool _bidirectShutdown = true;
|
||||
|
||||
friend class SecureStreamSocketImpl;
|
||||
friend class Context;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -42,6 +42,9 @@ public:
|
||||
SSL_SESSION* sslSession() const;
|
||||
/// Returns the stored OpenSSL SSL_SESSION object.
|
||||
|
||||
bool isResumable() const;
|
||||
/// Returns true if the session is resumable.
|
||||
|
||||
protected:
|
||||
Session(SSL_SESSION* pSession);
|
||||
/// Creates a new Session object, using the given
|
||||
|
Reference in New Issue
Block a user