Changeset 31865 for main/trunk/gli


Ignore:
Timestamp:
2017-08-09T21:10:54+12:00 (7 years ago)
Author:
ak19
Message:
  1. Helpful messages appended to the Download log directing the user to turn on the No Certificate Checking option in Prefs' Connection tab, in case downloading over https fails because the site's certificate is invalid. 2. Must not forget to turn off no_check_certificate in Greenstone's wgetrc template wget config file in gs2build/build-src/packages/wget folder
Location:
main/trunk/gli
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/classes/dictionary.properties

    r31861 r31865  
    867867Mirroring.DownloadJob.Resume_Tooltip:Resume this download
    868868Mirroring.DownloadJob.Status:Downloaded {0} of {1} files ({2} warnings, {3} errors)
     869Mirroring.DownloadJob.Warning_No_Valid_Certificate:WARNING: Can't download from a site that doesn\'t have a (valid) security certificate.
     870Mirroring.DownloadJob.Enable_NoCheckCertificate:Enable 'No certificate checking' in Preferences > Connection to download insecurely from https URLs.
    869871Mirroring.DownloadJob.Waiting:Waiting to start
    870872Mirroring.DownloadJob.Waiting_User:Waiting for user action
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java

    r31831 r31865  
    10811081        AppendLineOnlyFileDocument download_log = DownloadJob.this.download_log;
    10821082
     1083        boolean noCheckCertificate_needed = false; // determine whether this flag needs to be set for wget (under Preferences > Connection)
     1084       
    10831085        while (!Thread.currentThread().isInterrupted() && (line = br.readLine()) != null
    10841086               && !line.trim().equals("<<Finished>>") /*&& !isStopped()*/) {
     
    11001102                DebugStream.println("***** Requesting robot.txt");
    11011103                ignore_for_robots = true;
     1104            }
     1105            else if(line.indexOf("--no-check-certificate") != -1) {
     1106                downloadWarning();
     1107                noCheckCertificate_needed = true;
    11021108            }
    11031109            // If line contains "=> `" display text as the
     
    11801186            }
    11811187        }
     1188        if(noCheckCertificate_needed) { // can't download from (some nested) URL as its
     1189            // certificate can't be verified. User must turn on --no-check-certificate
     1190            // if they want to download from there anyway, but it will do so insecurely
     1191            download_log.appendLine("************");
     1192            download_log.appendLine(Dictionary.get("Mirroring.DownloadJob.Warning_No_Valid_Certificate"));
     1193            download_log.appendLine(Dictionary.get("Mirroring.DownloadJob.Enable_NoCheckCertificate"));
     1194            download_log.appendLine("************");
     1195        }
    11821196       
    11831197        } catch (IOException ioe) {
Note: See TracChangeset for help on using the changeset viewer.