Fossil SCM

Work around missing BIO_set_conn_ip_family() API in LibreSSL. This fixes [forum:/forumpost/a52cbed8f228397e|forum post a52cbed8f], I'm told.

drh 2025-03-21 23:29 trunk
Commit 50ff741f6ffb4f4f15e73dc43fc975e790ca2a63865ef9bedd0d49357418de14
1 file changed +8
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -452,11 +452,15 @@
452452
if( pUrlData->useProxy ){
453453
int rc;
454454
char *connStr = mprintf("%s:%d", g.url.name, pUrlData->port);
455455
BIO *sBio = BIO_new_connect(connStr);
456456
if( g.fIPv4 ){
457
+#ifdef BIO_FAMILY_IPV4
457458
BIO_set_conn_ip_family(sBio, BIO_FAMILY_IPV4);
459
+#else
460
+ fossil_warning("The --ipv4 option is not supported in this build\n");
461
+#endif
458462
}
459463
fossil_free(connStr);
460464
if( BIO_do_connect(sBio)<=0 ){
461465
ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)",
462466
pUrlData->name, pUrlData->port,
@@ -508,11 +512,15 @@
508512
if( !pUrlData->useProxy ){
509513
char *connStr = mprintf("%s:%d", pUrlData->name, pUrlData->port);
510514
BIO_set_conn_hostname(iBio, connStr);
511515
fossil_free(connStr);
512516
if( g.fIPv4 ){
517
+#ifdef BIO_FAMILY_IPV4
513518
BIO_set_conn_ip_family(iBio, BIO_FAMILY_IPV4);
519
+#else
520
+ fossil_warning("The --ipv4 option is not supported in this build\n");
521
+#endif
514522
}
515523
if( BIO_do_connect(iBio)<=0 ){
516524
ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)",
517525
pUrlData->name, pUrlData->port,
518526
ERR_reason_error_string(ERR_get_error()));
519527
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -452,11 +452,15 @@
452 if( pUrlData->useProxy ){
453 int rc;
454 char *connStr = mprintf("%s:%d", g.url.name, pUrlData->port);
455 BIO *sBio = BIO_new_connect(connStr);
456 if( g.fIPv4 ){
 
457 BIO_set_conn_ip_family(sBio, BIO_FAMILY_IPV4);
 
 
 
458 }
459 fossil_free(connStr);
460 if( BIO_do_connect(sBio)<=0 ){
461 ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)",
462 pUrlData->name, pUrlData->port,
@@ -508,11 +512,15 @@
508 if( !pUrlData->useProxy ){
509 char *connStr = mprintf("%s:%d", pUrlData->name, pUrlData->port);
510 BIO_set_conn_hostname(iBio, connStr);
511 fossil_free(connStr);
512 if( g.fIPv4 ){
 
513 BIO_set_conn_ip_family(iBio, BIO_FAMILY_IPV4);
 
 
 
514 }
515 if( BIO_do_connect(iBio)<=0 ){
516 ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)",
517 pUrlData->name, pUrlData->port,
518 ERR_reason_error_string(ERR_get_error()));
519
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -452,11 +452,15 @@
452 if( pUrlData->useProxy ){
453 int rc;
454 char *connStr = mprintf("%s:%d", g.url.name, pUrlData->port);
455 BIO *sBio = BIO_new_connect(connStr);
456 if( g.fIPv4 ){
457 #ifdef BIO_FAMILY_IPV4
458 BIO_set_conn_ip_family(sBio, BIO_FAMILY_IPV4);
459 #else
460 fossil_warning("The --ipv4 option is not supported in this build\n");
461 #endif
462 }
463 fossil_free(connStr);
464 if( BIO_do_connect(sBio)<=0 ){
465 ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)",
466 pUrlData->name, pUrlData->port,
@@ -508,11 +512,15 @@
512 if( !pUrlData->useProxy ){
513 char *connStr = mprintf("%s:%d", pUrlData->name, pUrlData->port);
514 BIO_set_conn_hostname(iBio, connStr);
515 fossil_free(connStr);
516 if( g.fIPv4 ){
517 #ifdef BIO_FAMILY_IPV4
518 BIO_set_conn_ip_family(iBio, BIO_FAMILY_IPV4);
519 #else
520 fossil_warning("The --ipv4 option is not supported in this build\n");
521 #endif
522 }
523 if( BIO_do_connect(iBio)<=0 ){
524 ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)",
525 pUrlData->name, pUrlData->port,
526 ERR_reason_error_string(ERR_get_error()));
527

Keyboard Shortcuts

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