mirror of https://github.com/Icinga/icinga2.git
parent
98a97026f4
commit
231fd8d38b
|
@ -193,11 +193,16 @@ void SetTlsProtocolminToSSLContext(const boost::shared_ptr<SSL_CTX>& context, co
|
||||||
|
|
||||||
flags |= SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
|
flags |= SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
|
||||||
|
|
||||||
|
#ifdef SSL_TXT_TLSV1_1
|
||||||
if (tlsProtocolmin == SSL_TXT_TLSV1_1)
|
if (tlsProtocolmin == SSL_TXT_TLSV1_1)
|
||||||
flags |= SSL_OP_NO_TLSv1;
|
flags |= SSL_OP_NO_TLSv1;
|
||||||
else if (tlsProtocolmin == SSL_TXT_TLSV1_2)
|
else
|
||||||
|
#elif defined(SSL_TXT_TLSV1_2)
|
||||||
|
if (tlsProtocolmin == SSL_TXT_TLSV1_2)
|
||||||
flags |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1;
|
flags |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1;
|
||||||
else if (tlsProtocolmin != SSL_TXT_TLSV1)
|
else
|
||||||
|
#endif /* SSL_TXT_TLSV1_2 */
|
||||||
|
if (tlsProtocolmin != SSL_TXT_TLSV1)
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid TLS protocol version specified."));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid TLS protocol version specified."));
|
||||||
|
|
||||||
SSL_CTX_set_options(context.get(), flags);
|
SSL_CTX_set_options(context.get(), flags);
|
||||||
|
|
|
@ -1184,10 +1184,18 @@ void ApiListener::ValidateTlsProtocolmin(const String& value, const ValidationUt
|
||||||
{
|
{
|
||||||
ObjectImpl<ApiListener>::ValidateTlsProtocolmin(value, utils);
|
ObjectImpl<ApiListener>::ValidateTlsProtocolmin(value, utils);
|
||||||
|
|
||||||
if (value != SSL_TXT_TLSV1 && value != SSL_TXT_TLSV1_1 &&
|
if (value != SSL_TXT_TLSV1
|
||||||
value != SSL_TXT_TLSV1_2) {
|
#ifdef SSL_TXT_TLSV1_1
|
||||||
|
&& value != SSL_TXT_TLSV1_1 &&
|
||||||
|
value != SSL_TXT_TLSV1_2
|
||||||
|
#endif /* SSL_TXT_TLSV1_1 */
|
||||||
|
) {
|
||||||
BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("tls_protocolmin"), "Invalid TLS version. "
|
BOOST_THROW_EXCEPTION(ValidationError(this, boost::assign::list_of("tls_protocolmin"), "Invalid TLS version. "
|
||||||
"Must be one of '" SSL_TXT_TLSV1 "', '" SSL_TXT_TLSV1_1 "' or '" SSL_TXT_TLSV1_2 "'"));
|
"Must be one of '" SSL_TXT_TLSV1 "'"
|
||||||
|
#ifdef SSL_TXT_TLSV1_1
|
||||||
|
", '" SSL_TXT_TLSV1_1 "' or '" SSL_TXT_TLSV1_2 "'"
|
||||||
|
#endif /* SSL_TXT_TLSV1_1 */
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue