#3299: NetSSL: Allow per-Context InvalidCertificateHandler

This commit is contained in:
Günter Obiltschnig
2021-06-06 18:11:05 +02:00
parent 3249abe2a4
commit ab010473b9
14 changed files with 166 additions and 27 deletions

View File

@@ -278,6 +278,10 @@ protected:
/// Throws a InvalidStateException if not application instance
/// is available.
int contextIndex() const;
/// Returns the index for SSL_CTX_set_ex_data() and SSL_CTX_get_ex_data() to
/// store the Context* in the underlying SSL_CTX.
private:
SSLManager();
/// Creates the SSLManager.
@@ -310,6 +314,7 @@ private:
Context::Ptr _ptrDefaultClientContext;
PrivateKeyPassphraseHandlerPtr _ptrClientPassphraseHandler;
InvalidCertificateHandlerPtr _ptrClientCertificateHandler;
int _contextIndex;
Poco::FastMutex _mutex;
static const std::string CFG_PRIV_KEY_FILE;
@@ -389,6 +394,12 @@ inline int SSLManager::verifyClientCallback(int ok, X509_STORE_CTX* pStore)
}
inline int SSLManager::contextIndex() const
{
return _contextIndex;
}
} } // namespace Poco::Net