Fossil SCM

Fix src/http_ssl.c in [6753e74e26c9167c] so that it works with older versions of OpenSSL found on archaic platforms that cannot upgrade.

drh 2026-11-15 16:01 UTC trunk
Commit a04df47528b150f5e5dc4bf4235b05be8e6af3e3b42a3d3abf37afb63b8d9c84
1 file changed +5
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -457,17 +457,22 @@
457457
** Return true if zHost is an IPv4 or IPv6 address. A certificate
458458
** lists an IP address separately from its DNS names, and RFC 6066 does not
459459
** permit an IP address as the TLS server name.
460460
*/
461461
static int ssl_host_is_ip_address(const char *zHost){
462
+#if OPENSSL_VERSION_NUMBER >= 0x010002000
462463
ASN1_OCTET_STRING *pIp = a2i_IPADDRESS(zHost);
463464
if( pIp==0 ){
464465
ERR_clear_error();
465466
return 0;
466467
}
467468
ASN1_OCTET_STRING_free(pIp);
468469
return 1;
470
+#else
471
+ (void)zHost;
472
+ return 0; /* old OpenSSL: IP-vs-name distinction is never used */
473
+#endif
469474
}
470475
471476
/*
472477
** Return true if zHost contains a byte outside ASCII. RFC 6066 permits
473478
** only an ASCII DNS name as the TLS server name, so an internationalized
474479
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -457,17 +457,22 @@
457 ** Return true if zHost is an IPv4 or IPv6 address. A certificate
458 ** lists an IP address separately from its DNS names, and RFC 6066 does not
459 ** permit an IP address as the TLS server name.
460 */
461 static int ssl_host_is_ip_address(const char *zHost){
 
462 ASN1_OCTET_STRING *pIp = a2i_IPADDRESS(zHost);
463 if( pIp==0 ){
464 ERR_clear_error();
465 return 0;
466 }
467 ASN1_OCTET_STRING_free(pIp);
468 return 1;
 
 
 
 
469 }
470
471 /*
472 ** Return true if zHost contains a byte outside ASCII. RFC 6066 permits
473 ** only an ASCII DNS name as the TLS server name, so an internationalized
474
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -457,17 +457,22 @@
457 ** Return true if zHost is an IPv4 or IPv6 address. A certificate
458 ** lists an IP address separately from its DNS names, and RFC 6066 does not
459 ** permit an IP address as the TLS server name.
460 */
461 static int ssl_host_is_ip_address(const char *zHost){
462 #if OPENSSL_VERSION_NUMBER >= 0x010002000
463 ASN1_OCTET_STRING *pIp = a2i_IPADDRESS(zHost);
464 if( pIp==0 ){
465 ERR_clear_error();
466 return 0;
467 }
468 ASN1_OCTET_STRING_free(pIp);
469 return 1;
470 #else
471 (void)zHost;
472 return 0; /* old OpenSSL: IP-vs-name distinction is never used */
473 #endif
474 }
475
476 /*
477 ** Return true if zHost contains a byte outside ASCII. RFC 6066 permits
478 ** only an ASCII DNS name as the TLS server name, so an internationalized
479

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button