libfetch: merge TLS SNI support from NetBSD with some other random changes.

Close GH #41
This commit is contained in:
Juan RP
2014-06-28 12:01:00 +02:00
parent 32161d5dd9
commit 633c20a2e6
4 changed files with 30 additions and 6 deletions

View File

@ -740,8 +740,9 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached)
if ((conn = fetch_connect(URL, 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_ssl(conn, URL, verbose) != 0) {
fetch_close(conn);
/* grrr */
#ifdef EAUTH