This commit is contained in:
John Sully 2022-04-20 21:19:34 +00:00
commit 0fb5e74339
2 changed files with 95 additions and 80 deletions

View File

@ -491,6 +491,12 @@ bool tlsCheckAgainstAllowlist(const char * client){
return false; return false;
} }
/* ASN1_STRING_get0_data was introduced in OPENSSL 1.1.1
* use ASN1_STRING_data for older versions where it is not available */
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#define ASN1_STRING_get0_data ASN1_STRING_data
#endif
bool tlsValidateCertificateName(tls_connection* conn){ bool tlsValidateCertificateName(tls_connection* conn){
if (g_pserver->tls_allowlist.empty()) if (g_pserver->tls_allowlist.empty())
return true; // Empty list implies acceptance of all return true; // Empty list implies acceptance of all

View File

@ -1,3 +1,6 @@
# only run this test if tls is enabled
if {$::tls} {
package require tls
test {TLS: Able to connect with no allowlist} { test {TLS: Able to connect with no allowlist} {
start_server {tags {"tls"}} { start_server {tags {"tls"}} {
catch {r PING} e catch {r PING} e
@ -109,3 +112,9 @@ test {TLS: Able to match against URI SAN} {
assert_match {PONG} $e assert_match {PONG} $e
} }
} }
} else {
start_server {} {
# just a dummy server so that the test doesn't panic if tls is disabled
# otherwise the test will try to bind to a server that just isn't there
}
}