diff --git a/apps/include/http_server.h b/apps/include/http_server.h index 4811e6be40137c..3d3f298a1dc429 100644 --- a/apps/include/http_server.h +++ b/apps/include/http_server.h @@ -38,7 +38,7 @@ # ifndef OPENSSL_NO_SOCK /*- - * Initialize an HTTP server, setting up its listening BIO + * Initialize an HTTP server, setting up its listening BIO, using IPv4 or v6 * prog: the name of the current app * port: the port to listen on * verbosity: the level of verbosity to use, or -1 for default: LOG_INFO diff --git a/apps/lib/http_server.c b/apps/lib/http_server.c index 48daea78fd5e38..765c016a37c16e 100644 --- a/apps/lib/http_server.c +++ b/apps/lib/http_server.c @@ -202,6 +202,7 @@ BIO *http_server_init(const char *prog, const char *port, int verb) goto err; acbio = BIO_new(BIO_s_accept()); if (acbio == NULL + || BIO_set_accept_ip_family(acbio, BIO_FAMILY_IPANY) <= 0 /* IPv4/6 */ || BIO_set_bind_mode(acbio, BIO_BIND_REUSEADDR) <= 0 || BIO_set_accept_name(acbio, name) <= 0) { log_HTTP(prog, LOG_ERR, "error setting up accept BIO");