-/* $OpenBSD: fetch.c,v 1.127 2014/08/21 16:46:48 jca Exp $ */
+/* $OpenBSD: fetch.c,v 1.128 2014/08/25 11:33:55 jca Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
}
path = newline;
+ } else if (ishttpsurl) {
+ sslhost = strdup(host);
+ if (sslhost == NULL)
+ errx(1, "Can't allocate memory for https path/host.");
}
if (isfileurl) {
ressl_error(ssl));
goto cleanup_url_get;
}
- if (ressl_connect_socket(ssl, s, host) != 0) {
+ if (ressl_connect_socket(ssl, s, sslhost) != 0) {
fprintf(ttyout, "SSL failure: %s\n", ressl_error(ssl));
goto cleanup_url_get;
}
ressl_free(ssl);
}
free(full_host);
+ free(sslhost);
#endif /* !SMALL */
if (fin != NULL)
fclose(fin);