summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 8639e00..7b897a8 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -669,7 +669,7 @@ _http_connect(struct url *URL, struct url *purl, const char *flags)
af = AF_INET6;
#endif
- if (purl) {
+ if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) {
URL = purl;
} else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) {
/* can't talk http to an ftp server */
@@ -680,6 +680,11 @@ _http_connect(struct url *URL, struct url *purl, const char *flags)
if ((conn = _fetch_connect(URL->host, URL->port, af, verbose)) == NULL)
/* _fetch_connect() has already set an error code */
return (NULL);
+ if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 &&
+ _fetch_ssl(conn, verbose) == -1) {
+ _fetch_close(conn);
+ return (NULL);
+ }
return (conn);
}
OpenPOWER on IntegriCloud