mirror of https://github.com/Icinga/icinga2.git
MakeSSLContext: Check if keys match.
This commit is contained in:
parent
e7f1e3b2ef
commit
a03c58f27e
|
@ -70,6 +70,12 @@ shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey,
|
|||
<< boost::errinfo_file_name(privkey));
|
||||
}
|
||||
|
||||
if (!SSL_CTX_check_private_key(sslContext.get())) {
|
||||
BOOST_THROW_EXCEPTION(openssl_error()
|
||||
<< boost::errinfo_api_function("SSL_CTX_check_private_key")
|
||||
<< errinfo_openssl_error(ERR_get_error()));
|
||||
}
|
||||
|
||||
if (!SSL_CTX_load_verify_locations(sslContext.get(), cakey.CStr(), NULL)) {
|
||||
BOOST_THROW_EXCEPTION(openssl_error()
|
||||
<< boost::errinfo_api_function("SSL_CTX_load_verify_locations")
|
||||
|
|
Loading…
Reference in New Issue