Skip to content

Commit 51e3cb3

Browse files
committed
Don't generate spurious warning is security_level not supported
People should not have to worry about the used openssl version when downgrading security_level.
1 parent b281493 commit 51e3cb3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/openssl/xp_ssl.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,16 +1711,12 @@ int php_openssl_setup_crypto(php_stream *stream,
17111711
}
17121712

17131713
if (GET_VER_OPT("security_level")) {
1714-
#ifdef HAVE_SEC_LEVEL
17151714
zend_long lval = zval_get_long(val);
17161715
if (lval < 0 || lval > 5) {
17171716
php_error_docref(NULL, E_WARNING, "Security level must be between 0 and 5");
17181717
}
1718+
#ifdef HAVE_SEC_LEVEL
17191719
SSL_CTX_set_security_level(sslsock->ctx, lval);
1720-
#else
1721-
php_error_docref(NULL, E_WARNING,
1722-
"security_level is not supported by the linked OpenSSL library "
1723-
"- it is supported from version 1.1.0");
17241720
#endif
17251721
}
17261722

0 commit comments

Comments
 (0)