diff --git a/NEWS b/NEWS index afea5829..8a4e3d82 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.38 (???): + * libxbps: the fetch code now is able to connect to HTTPS without the need of + /etc/services being available; We don't expect those ports to change anytime! + * xbps-uchroot(8) is now only built on linux, because it's not portable to other Operating Systems. diff --git a/lib/fetch/common.c b/lib/fetch/common.c index 60b13671..705c843a 100644 --- a/lib/fetch/common.c +++ b/lib/fetch/common.c @@ -201,12 +201,14 @@ fetch_default_port(const char *scheme) { struct servent *se; - if ((se = getservbyname(scheme, "tcp")) != NULL) - return (ntohs(se->s_port)); if (strcasecmp(scheme, SCHEME_FTP) == 0) return (FTP_DEFAULT_PORT); if (strcasecmp(scheme, SCHEME_HTTP) == 0) return (HTTP_DEFAULT_PORT); + if (strcasecmp(scheme, SCHEME_HTTPS) == 0) + return (HTTPS_DEFAULT_PORT); + if ((se = getservbyname(scheme, "tcp")) != NULL) + return (ntohs(se->s_port)); return (0); } diff --git a/lib/fetch/common.h b/lib/fetch/common.h index 63170907..2c363217 100644 --- a/lib/fetch/common.h +++ b/lib/fetch/common.h @@ -34,6 +34,7 @@ #define FTP_DEFAULT_PORT 21 #define HTTP_DEFAULT_PORT 80 +#define HTTPS_DEFAULT_PORT 443 #define FTP_DEFAULT_PROXY_PORT 21 #define HTTP_DEFAULT_PROXY_PORT 3128