mirror of
https://github.com/mirror/wget.git
synced 2025-03-26 01:30:14 +08:00
[svn] Initialize SSL only the first time when an SSL URL is encountered.
This commit is contained in:
parent
ddd2644bc8
commit
63d492c0ba
@ -1,3 +1,8 @@
|
|||||||
|
2003-11-29 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
|
* http.c (gethttp): Initialize SSL only the first time when SSL
|
||||||
|
URL is downloaded.
|
||||||
|
|
||||||
2003-11-29 Hrvoje Niksic <hniksic@xemacs.org>
|
2003-11-29 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
* cookies.c (cookie_header): Only generate the contents of the
|
* cookies.c (cookie_header): Only generate the contents of the
|
||||||
|
51
src/http.c
51
src/http.c
@ -1033,31 +1033,34 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
|
|||||||
int host_lookup_failed = 0;
|
int host_lookup_failed = 0;
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
/* Initialize the SSL context. After the first run, this is a
|
if (u->scheme == SCHEME_HTTPS)
|
||||||
no-op. */
|
|
||||||
switch (ssl_init ())
|
|
||||||
{
|
{
|
||||||
case SSLERRCTXCREATE:
|
/* Initialize the SSL context. After this has once been done,
|
||||||
/* this is fatal */
|
it becomes a no-op. */
|
||||||
logprintf (LOG_NOTQUIET, _("Failed to set up an SSL context\n"));
|
switch (ssl_init ())
|
||||||
return SSLERRCTXCREATE;
|
{
|
||||||
case SSLERRCERTFILE:
|
case SSLERRCTXCREATE:
|
||||||
/* try without certfile */
|
/* this is fatal */
|
||||||
logprintf (LOG_NOTQUIET,
|
logprintf (LOG_NOTQUIET, _("Failed to set up an SSL context\n"));
|
||||||
_("Failed to load certificates from %s\n"),
|
return SSLERRCTXCREATE;
|
||||||
opt.sslcertfile);
|
case SSLERRCERTFILE:
|
||||||
logprintf (LOG_NOTQUIET,
|
/* try without certfile */
|
||||||
_("Trying without the specified certificate\n"));
|
logprintf (LOG_NOTQUIET,
|
||||||
break;
|
_("Failed to load certificates from %s\n"),
|
||||||
case SSLERRCERTKEY:
|
opt.sslcertfile);
|
||||||
logprintf (LOG_NOTQUIET,
|
logprintf (LOG_NOTQUIET,
|
||||||
_("Failed to get certificate key from %s\n"),
|
_("Trying without the specified certificate\n"));
|
||||||
opt.sslcertkey);
|
break;
|
||||||
logprintf (LOG_NOTQUIET,
|
case SSLERRCERTKEY:
|
||||||
_("Trying without the specified certificate\n"));
|
logprintf (LOG_NOTQUIET,
|
||||||
break;
|
_("Failed to get certificate key from %s\n"),
|
||||||
default:
|
opt.sslcertkey);
|
||||||
break;
|
logprintf (LOG_NOTQUIET,
|
||||||
|
_("Trying without the specified certificate\n"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user