mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
libkmipclient: Adjustments for OpenSSL v4.0.0 API changes and deprecations
With OpenSSL 4.0.0 function SSL_set1_host() is deprecated and should be replaced by SSL_set1_ipaddr() and SSL_set1_dnsname(). Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
7e68d7f61a
commit
93f8d093ce
@@ -378,8 +378,14 @@ int kmip_connection_tls_init(struct kmip_connection *conn, bool debug)
|
||||
if (conn->config.tls_verify_host) {
|
||||
SSL_set_hostflags(conn->plain_tls.ssl,
|
||||
X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
|
||||
#if OPENSSL_VERSION_PREREQ(4, 0)
|
||||
if (SSL_set1_ipaddr(conn->plain_tls.ssl, hostname) != 1 &&
|
||||
SSL_set1_dnsname(conn->plain_tls.ssl, hostname) != 1) {
|
||||
kmip_debug(debug, "SSL_set1_ipaddr/dnsname failed");
|
||||
#else
|
||||
if (SSL_set1_host(conn->plain_tls.ssl, hostname) != 1) {
|
||||
kmip_debug(debug, "SSL_set1_host failed");
|
||||
#endif
|
||||
if (debug)
|
||||
ERR_print_errors_fp(stderr);
|
||||
rc = -EIO;
|
||||
|
||||
Reference in New Issue
Block a user