xdtianyu / scripts

scripts for work
https://www.xdty.org
1.03k stars 245 forks source link

little change on wget #40

Closed tangbao closed 7 years ago

tangbao commented 7 years ago

in my system, the script cannot run properly unless adding " --no-check-certificate" to wget

xdtianyu commented 7 years ago

Thanks, merged. By the way, I think install or update the ca-certificates package is a better solution.

tangbao commented 7 years ago

But it's a universal way, doesn't it? 23333

xdtianyu commented 7 years ago

@tangbaobao https://www.gnu.org/software/wget/manual/html_node/HTTPS-_0028SSL_002fTLS_0029-Options.html

‘--no-check-certificate’ Don’t check the server certificate against the available certificate authorities. Also don’t require the URL host name to match the common name presented by the certificate.

As of Wget 1.10, the default is to verify the server’s certificate against the recognized certificate authorities, breaking the SSL handshake and aborting the download if the verification fails. Although this provides more secure downloads, it does break interoperability with some sites that worked with previous Wget versions, particularly those using self-signed, expired, or otherwise invalid certificates. This option forces an “insecure” mode of operation that turns the certificate verification errors into warnings and allows you to proceed.

If you encounter “certificate verification” errors or ones saying that “common name doesn’t match requested host name”, you can use this option to bypass the verification and proceed with the download. Only use this option if you are otherwise convinced of the site’s authenticity, or if you really don’t care about the validity of its certificate. It is almost always a bad idea not to check the certificates when transmitting confidential or important data. For self-signed/internal certificates, you should download the certificate and verify against that instead of forcing this insecure mode. If you are really sure of not desiring any certificate verification, you can specify –check-certificate=quiet to tell wget to not print any warning about invalid certificates, albeit in most cases this is the wrong thing to do.