mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
Set EVP private key on SSL context (#2259)
This commit is contained in:
committed by
Aleksandar Fabijanic
parent
612f092235
commit
5fb10f6746
@@ -237,6 +237,17 @@ void Context::usePrivateKey(const Poco::Crypto::RSAKey& key)
|
||||
}
|
||||
|
||||
|
||||
void Context::usePrivateKey(const Poco::Crypto::EVPPKey& pkey)
|
||||
{
|
||||
int errCode = SSL_CTX_use_PrivateKey(_pSSLContext, const_cast<EVP_PKEY*>(static_cast<const EVP_PKEY*>(pkey)));
|
||||
if (errCode != 1)
|
||||
{
|
||||
std::string msg = Utility::getLastError();
|
||||
throw SSLContextException("Cannot set private key for Context", msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Context::enableSessionCache(bool flag)
|
||||
{
|
||||
if (flag)
|
||||
|
||||
Reference in New Issue
Block a user