@@ -296,7 +296,7 @@ Shared<TlsContext>::Ptr SetupSslContext(const String& certPath, const String& ke
296
296
297
297
if (!protocolmin.IsEmpty ()){
298
298
try {
299
- SetTlsProtocolminToSSLContext (context, protocolmin);
299
+ SetTlsProtocolminToSSLContext (context, ResolveTlsProtocolVersion ( protocolmin) );
300
300
} catch (const std::exception &) {
301
301
BOOST_THROW_EXCEPTION (ScriptError (" Cannot set minimum TLS protocol version to SSL context with tls_protocolmin: '" + protocolmin + " '." , std::move (di)));
302
302
}
@@ -311,10 +311,10 @@ Shared<TlsContext>::Ptr SetupSslContext(const String& certPath, const String& ke
311
311
* @param context The ssl context.
312
312
* @param tlsProtocolmin The minimum TLS protocol version.
313
313
*/
314
- void SetTlsProtocolminToSSLContext (const Shared<TlsContext>::Ptr & context, const String& tlsProtocolmin)
314
+ void SetTlsProtocolminToSSLContext (const Shared<TlsContext>::Ptr & context, TlsProtocolMin tlsProtocolmin)
315
315
{
316
316
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
317
- int ret = SSL_CTX_set_min_proto_version (context->native_handle (), ResolveTlsProtocolVersion ( tlsProtocolmin) );
317
+ int ret = SSL_CTX_set_min_proto_version (context->native_handle (), tlsProtocolmin);
318
318
319
319
if (ret != 1 ) {
320
320
char errbuf[256 ];
@@ -329,7 +329,7 @@ void SetTlsProtocolminToSSLContext(const Shared<TlsContext>::Ptr& context, const
329
329
#else /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
330
330
// This should never happen. On this OpenSSL version, ResolveTlsProtocolVersion() should either return TLS 1.2
331
331
// or throw an exception, as that's the only TLS version supported by both Icinga and ancient OpenSSL.
332
- VERIFY (ResolveTlsProtocolVersion ( tlsProtocolmin) == TLS1_2_VERSION);
332
+ VERIFY (tlsProtocolmin == TLS1_2_VERSION);
333
333
#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
334
334
}
335
335
0 commit comments