GLI Downloading panel HTTPS/SSL support and other wget changes
|Reported by:||ak19||Owned by:||ak19|
GLI wasn't able to download from https URLs because there was no SSL support. Some other surrounding issues were identified and also needed fixing.
I didn't at first know there was no https support and that this was because wget hadn't been compiled with SSL. I only discovered this after the following two fixes, which allowed better debugging:
- Adding shutdownhook for GS2 to ensure the GS2 server is stopped on Ctrl-C. Tested on Linux.
"Fix to getRedirectURL() being stuck forever if the proxy details are wrong. I still can't work out what my proxy settings should be to get downloading to work from a TSG-adminsitered machine, but at least now GLI doesn't hang requiring a ctrl-C to terminate it."
- Compiling up wget on Unix with open SSL to support https URLs required upgrading our wget to a newer version (from 1.15 to 1.17.1) and also compiling up OpenSSL now, which we didn't do before. We also got a precompiled windows wget binary of 1.17.1, compiled with SSL support, upgrading from shipping a windows wget 1.11.x binary that didn't include SSL.
- GLI changes:
- Wget upgrade and setting no-check-certificate using Wgetrc conf file, needed in newer wget versions compiled on Linux to be able to download from https urls that don't have valid site certificates:
- Fixes to get proxying to work and surrounding issues
Further modifications to GLI getRedirectURL()
New class URLConnectionManager to enable accessing web pages in "no-check-certificate" mode from Java code. Needed by getRedirectURL()
- getRedirectURL() phased out: http://trac.greenstone.org/changeset/31852
To get proxying to work on Windows and other issues:
- no-check-certificate supported through GLI Preferences interface rather than wgetrc conf file:
- Changes to get helpful messages on connection failures to display.
Only for windows, proxy_on, proxy_port and proxy_host would be set (along with username and pwd), while on Linux none of these would be set as proxy settings were obtained by wget from env vars that were set up.
To get helpful messages to display, proxy_on, proxy_port and proxy_host needed to be setup regardless of the OS.
- Shifting to Windows using proxy settings set up in the environment (as linux does) rather than passing proxy flags to wget.
- Shifting from single to support for multiple proxy URLs: one each for HTTP, HTTPS and FTP.
- GLI informs user when existing proxy settings in environment (from before launching GLI) are overridden with custom proxy settings turned on and set up within GLI.