Ignore:
Timestamp:
2017-08-09T16:48:21+12:00 (7 years ago)
Author:
ak19
Message:

The changes necessary for getting the new no_check_certificate checkbox to appear and work in GLI and get propagated to the perl code that launches wget. This checkbox controls whether wget is launched with the no-check-certificate flag to retrieve Https URLs despite lack of (valid) certificates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java

    r31852 r31860  
    571571        // redirect url (we do this step in order to avoid some unintuitive behaviour from wget)
    572572        Download current_download = (Download)download_map.get(mode);
     573       
     574        boolean noCheckCertificate = Configuration.get("general.no_check_certificate", true);       
     575        Argument no_check_cert_arg = current_download.getArgument("no_check_certificate");
     576        if(noCheckCertificate) {
     577            no_check_cert_arg.setValue("true");
     578            no_check_cert_arg.setAssigned(true);
     579        } else {
     580            no_check_cert_arg.setValue("false");
     581            no_check_cert_arg.setAssigned(false); // only assigned Arguments have values
     582        }
     583
    573584        Argument arg_url = current_download.getArgument("url");
    574585       
     
    576587            String url_str = arg_url.getValue();   
    577588           
    578             // No longer following URL redirects, since some of this has been taken care of by wget
    579             // For the rest, assume the user will get the URL right that they want to download from
    580             /*
    581             String redirect_url_str = getRedirectURL(url_str);
    582            
    583             // only update the Argument and its GUI ArgumentControl if the URL
    584             // has in fact changed
    585             if(!url_str.equals(redirect_url_str)) {
    586             arg_url.setValue(redirect_url_str);
    587             updateArgument(arg_url, redirect_url_str);
    588             }
    589             */
     589            // No longer following URL redirects, since some of this has been taken care of by wget
     590            // For the rest, assume the user will get the URL right that they want to download from
     591            /*
     592              String redirect_url_str = getRedirectURL(url_str);
     593             
     594              // only update the Argument and its GUI ArgumentControl if the URL
     595              // has in fact changed
     596              if(!url_str.equals(redirect_url_str)) {
     597              arg_url.setValue(redirect_url_str);
     598              updateArgument(arg_url, redirect_url_str);
     599              }
     600            */
    590601        }
    591602       
     
    758769        // Write the use proxy command - we don't do this anymore, instead we set environment variables - hopefully these can't be spied on like the following can (using ps) - actually the environment stuff didn't work for windows, so lets go back to this
    759770        if (Utility.isWindows()) {
    760             
    761            arg.setValue("true");
     771           
     772           arg.setValue("true"); // proxy_on argument
    762773           arg.setAssigned(true);
    763 
     774           
    764775           arg = current_download.getArgument("proxy_host");
    765776           arg.setValue(proxy_host);
    766777           arg.setAssigned(true);
    767 
     778           
    768779           arg = current_download.getArgument("proxy_port");
    769780           arg.setValue(proxy_port);
    770781           arg.setAssigned(true);
    771 
     782       
    772783           arg = current_download.getArgument("user_name");
    773784           arg.setValue(user_pass.substring(0, user_pass.indexOf("@")));
     
    822833        }
    823834
     835        boolean noCheckCertificate = Configuration.get("general.no_check_certificate", true);
     836        Argument no_check_cert_arg = current_download.getArgument("no_check_certificate");
     837        if(noCheckCertificate) {       
     838        no_check_cert_arg.setValue("true");
     839        no_check_cert_arg.setAssigned(true);
     840        } else {
     841        no_check_cert_arg.setValue("false");
     842        no_check_cert_arg.setAssigned(false); // only assigned Arguments have values
     843        }
     844       
     845       
    824846        //str_url = getRedirectURL(str_url); // work out the real URL
    825847
Note: See TracChangeset for help on using the changeset viewer.