Ignore SSL certificate error with Wget

I have a code in my coldfusion code that works:

<cfexecute name="curl" arguments = "https://myPath/myFile.xlsx -k" timeout="10" variable="test" />
<cfdump var="#test#" />

      

Loads the Excel file from the specified path using cURL and dumps it to the browser which works fine.

However, I can't seem to get the same thing to work with Wget.

First I tried:

<cfexecute name="wget" arguments = "https://myPath/myFile.xlsx" timeout="10" variable="test" />
<cfdump var="#test#" />

      

This returns an empty string. It seems we need to use the cURL equivalent "-k" for Wget to tell it to ignore SSL certificate errors. So I tried:

<cfexecute name="wget" arguments = "--no-check-certificate https://myPath/myFile.xlsx" timeout="10" variable="test" />
<cfdump var="#test#" />

      

This gives me the following results:

Usage: wget [OPTION]... [URL]... Try `wget --help' for more options. 

      

How can I use Wget in cfexecute to download the excel file while ignoring SSL certificate errors?

EDIT:

Works wget --no-check-certificate "https://myPath/myFile.xlsx"

directly from the command line.

+3


source to share


1 answer


From the wget man page ( http://linux.die.net/man/1/wget )

"HTTPS Settings (SSL / TLS)

To support encrypted HTTP downloads (HTTPS), Wget must be compiled with an external SSL library, currently OpenSSL. If Wget is compiled without SSL support, none of these options are available. "

You may need to check if the SSL version of wget is supported.



Can cfhttp do what you need?

https://wikidocs.adobe.com/wiki/display/coldfusionen/cfhttp

If you are using a self signed certificate, you can add it to the JVM keystore to avoid certificate errors.

+2


source







All Articles