Use wget Command To Download Files From HTTPS Domains

How do I download a file using https://example.com/dl/foo.tar.gz using wget command line utility?

GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. The syntax is:

ADVERTISEMENTS

wget https://cyberciti.biz/foo/bar.tar.gz

Tutorial details
DifficultyEasy (rss)
Root privilegesNo
Requirementswget
TimeN/A
If you don’t want about checking the validity of the certificate just pass the option --no-check-certificate to the wget command-line:

wget --no-check-certificate https://cyberciti.biz/foo/bar.tar.gz

You can pass the --no-proxy option to the wget command. This option tells wget not to use proxies, even if the appropriate `*_proxy’ environment variable is defined:

wget --no-proxy https://cyberciti.biz/foo/bar.tar.gz

Set https proxy using httpd_proxy variable:

export https_proxy="https://USERNAME-HERE:PASSWORD-HERE@Server-Name-Here:PORT-NUMBER-HERE/"
export https_proxy="https://vivek:TopSecretePassword@server1.cyberciti.biz:3128/"
wget https://cyberciti.biz/foo/bar.tar.gz</kbd>

Or pass proxy server username and password to the server using wget command as follows:

export https_proxy="https://server1.cyberciti.biz:3128/"
wget --http-user="USER" --http-password="PASSWORD" https://cyberciti.biz/foo/bar.tar.gz</kbd>
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
5 comments… add one
  • Ahmed Dev Aug 16, 2014 @ 1:13

    Thanks That really helps

  • JZA Nov 13, 2014 @ 3:14

    I want to know how can I set by default the –no-check-certificate on wget for https. Is this possible?

    • samy Dec 11, 2014 @ 20:23

      Not sure if you found the answer in the meantime?
      You need to use: check-certificate = off (or check_certificate = off) in your .wgetrc startup file.

  • Ravinder Sep 7, 2017 @ 19:53

    Hi,

    I have used wget to login to the application with save cookies parameter in the first step. I have used .pem files for the SSL handshake.
    I pass userid and password to login to the app.

    In the 2nd step I use the same certificate .pem files , also the same cookies file generated in 1st step. This step actually calls the main function of the application to perform certain operation/job.

    Now the client doesn’t want to give userid and pass in the 1st step, I am not able to find a way how to directly invoke the function of 2nd step to call the application to do the job.

    Can you tell me how wget can be used in windows to call the main function by directly logging in to application.

    Thanks
    Ravi

  • Aneesh Sep 14, 2017 @ 14:32

    I am receiving ” Unsupported scheme” while using https://

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.