]> sjero.net Git - wget/commitdiff
[svn] Initialize SSL only the first time when an SSL URL is encountered.
authorhniksic <devnull@localhost>
Sat, 29 Nov 2003 22:24:55 +0000 (14:24 -0800)
committerhniksic <devnull@localhost>
Sat, 29 Nov 2003 22:24:55 +0000 (14:24 -0800)
src/ChangeLog
src/http.c

index 12931071c3cb2eedaa1b49d1368777f97950eea5..a4bc397229c4664d97eda791b7a9397a1a880668 100644 (file)
@@ -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>
 
        * cookies.c (cookie_header): Only generate the contents of the
index 7087d71f5150e7d84f7a0ad263272ab9f31cbf80..f514452b68c767193e71b60f46b8ff8a9964b311 100644 (file)
@@ -1033,31 +1033,34 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
   int host_lookup_failed = 0;
 
 #ifdef HAVE_SSL
-  /* Initialize the SSL context.  After the first run, this is a
-     no-op.  */
-  switch (ssl_init ())
+  if (u->scheme == SCHEME_HTTPS)
     {
-    case SSLERRCTXCREATE:
-      /* this is fatal */
-      logprintf (LOG_NOTQUIET, _("Failed to set up an SSL context\n"));
-      return SSLERRCTXCREATE;
-    case SSLERRCERTFILE:
-      /* try without certfile */
-      logprintf (LOG_NOTQUIET,
-                _("Failed to load certificates from %s\n"),
-                opt.sslcertfile);
-      logprintf (LOG_NOTQUIET,
-                _("Trying without the specified certificate\n"));
-      break;
-    case SSLERRCERTKEY:
-      logprintf (LOG_NOTQUIET,
-                _("Failed to get certificate key from %s\n"),
-                opt.sslcertkey);
-      logprintf (LOG_NOTQUIET,
-                _("Trying without the specified certificate\n"));
-      break;
-    default:
-      break;
+      /* Initialize the SSL context.  After this has once been done,
+        it becomes a no-op.  */
+      switch (ssl_init ())
+       {
+       case SSLERRCTXCREATE:
+         /* this is fatal */
+         logprintf (LOG_NOTQUIET, _("Failed to set up an SSL context\n"));
+         return SSLERRCTXCREATE;
+       case SSLERRCERTFILE:
+         /* try without certfile */
+         logprintf (LOG_NOTQUIET,
+                    _("Failed to load certificates from %s\n"),
+                    opt.sslcertfile);
+         logprintf (LOG_NOTQUIET,
+                    _("Trying without the specified certificate\n"));
+         break;
+       case SSLERRCERTKEY:
+         logprintf (LOG_NOTQUIET,
+                    _("Failed to get certificate key from %s\n"),
+                    opt.sslcertkey);
+         logprintf (LOG_NOTQUIET,
+                    _("Trying without the specified certificate\n"));
+         break;
+       default:
+         break;
+       }
     }
 #endif /* HAVE_SSL */