Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 242010

Use insecure SSL connections and transfers with curl


If you have a self-signed SSL certificate with your server, and you want to connect to it using the curl command, you need to use the " -k/--insecure" option since curl only use the CA certificate bundle installed by default.


# curl -k https://localhost

Dec 232010

Show HTTP response using curl command


curl is a very powerful tool for transferring data from or to a server, which support many protocols such as HTTP, HTTPS, FTP etc.

Example: Issue a HTTP request to a remote server.

# curl -v

* About to connect() to port 80 (#0)
*   Trying connected
* Connected to ( port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.5 (x86_64-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/ libidn/1.15
> Host:
> Accept: */*
< HTTP/1.1 200 OK
< Server: Apache
< Last-Modified: Fri, 30 Jul 2010 15:30:18 GMT
< ETag: "573c1-254-48c9c87349680"
< Accept-Ranges: bytes
< Content-Type: text/html; charset=UTF-8
< Connection: Keep-Alive
< Date: Wed, 22 Dec 2010 16:19:06 GMT
< Age: 817
< Content-Length: 596
Nov 292010

How to simulate curl using wget command?


To simulate a simple curl command using wget, e.g. curl

# wget -O-

To view the HTTP response header (i.e. more verbose), e.g. curl -v

# wget -O- -S