Fossil SCM
Work around missing BIO_set_conn_ip_family() API in LibreSSL. This fixes [forum:/forumpost/a52cbed8f228397e|forum post a52cbed8f], I'm told.
Commit
50ff741f6ffb4f4f15e73dc43fc975e790ca2a63865ef9bedd0d49357418de14
Parent
f0d9fe2b0cd3cd6…
1 file changed
+8
+8
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -452,11 +452,15 @@ | ||
| 452 | 452 | if( pUrlData->useProxy ){ |
| 453 | 453 | int rc; |
| 454 | 454 | char *connStr = mprintf("%s:%d", g.url.name, pUrlData->port); |
| 455 | 455 | BIO *sBio = BIO_new_connect(connStr); |
| 456 | 456 | if( g.fIPv4 ){ |
| 457 | +#ifdef BIO_FAMILY_IPV4 | |
| 457 | 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 | |
| 458 | 462 | } |
| 459 | 463 | fossil_free(connStr); |
| 460 | 464 | if( BIO_do_connect(sBio)<=0 ){ |
| 461 | 465 | ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)", |
| 462 | 466 | pUrlData->name, pUrlData->port, |
| @@ -508,11 +512,15 @@ | ||
| 508 | 512 | if( !pUrlData->useProxy ){ |
| 509 | 513 | char *connStr = mprintf("%s:%d", pUrlData->name, pUrlData->port); |
| 510 | 514 | BIO_set_conn_hostname(iBio, connStr); |
| 511 | 515 | fossil_free(connStr); |
| 512 | 516 | if( g.fIPv4 ){ |
| 517 | +#ifdef BIO_FAMILY_IPV4 | |
| 513 | 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 | |
| 514 | 522 | } |
| 515 | 523 | if( BIO_do_connect(iBio)<=0 ){ |
| 516 | 524 | ssl_set_errmsg("SSL: cannot connect to host %s:%d (%s)", |
| 517 | 525 | pUrlData->name, pUrlData->port, |
| 518 | 526 | ERR_reason_error_string(ERR_get_error())); |
| 519 | 527 |
| --- 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 |