From e8048ad82610647bf49b9876d9eff4d889bf1177 Mon Sep 17 00:00:00 2001 From: Max Weisel Date: Thu, 5 May 2022 11:11:18 -0400 Subject: [PATCH] BoringSSL does not allow setting the hostname with a null-terminated string. The length is always required: https://boringssl.googlesource.com/boringssl/+/master/crypto/x509/x509_vpm.c#93 (#391) --- ixwebsocket/IXSocketOpenSSL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ixwebsocket/IXSocketOpenSSL.cpp b/ixwebsocket/IXSocketOpenSSL.cpp index 96ed860d..7fb6f6dc 100644 --- a/ixwebsocket/IXSocketOpenSSL.cpp +++ b/ixwebsocket/IXSocketOpenSSL.cpp @@ -755,7 +755,7 @@ namespace ix // 1.1.0, but it does not. To be on the safe side, the manual test // below is enabled for all versions prior to 1.1.0.) X509_VERIFY_PARAM* param = SSL_get0_param(_ssl_connection); - X509_VERIFY_PARAM_set1_host(param, host.c_str(), 0); + X509_VERIFY_PARAM_set1_host(param, host.c_str(), host.size()); #endif handshakeSuccessful = openSSLClientHandshake(host, errMsg, isCancellationRequested); }