]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Add --random-file option. Bail out in case of error during
[wget] / src / http.c
index 5d382deb3439a6adf58c3bef6e81d7161ee5e7e4..9162d85e3f662765a80cc722bc27a06bf6a6c116 100644 (file)
@@ -1187,29 +1187,12 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
     {
       /* Initialize the SSL context.  After this has once been done,
         it becomes a no-op.  */
-      switch (ssl_init ())
+      if (!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 */
+         scheme_disable (SCHEME_HTTPS);
          logprintf (LOG_NOTQUIET,
-                    _("Failed to load certificates from %s\n"),
-                    opt.cert_file);
-         logprintf (LOG_NOTQUIET,
-                    _("Trying without the specified certificate\n"));
-         break;
-       case SSLERRCERTKEY:
-         logprintf (LOG_NOTQUIET,
-                    _("Failed to get private key from %s\n"),
-                    opt.private_key);
-         logprintf (LOG_NOTQUIET,
-                    _("Trying without the specified certificate\n"));
-         break;
-       default:
-         break;
+                    _("Disabling SSL due to encountered errors.\n"));
+         return SSLINITFAILED;
        }
     }
 #endif /* HAVE_SSL */
@@ -2232,7 +2215,7 @@ File `%s' already there, will not retrieve.\n"), *hstat.local_file);
          continue;
          break;
        case HOSTERR: case CONIMPOSSIBLE: case PROXERR: case AUTHFAILED: 
-       case SSLERRCTXCREATE: case CONTNOTSUPPORTED:
+       case SSLINITFAILED: case CONTNOTSUPPORTED:
          /* Fatal errors just return from the function.  */
          free_hstat (&hstat);
          xfree_null (dummy);