Entering the following command
curl -k firstname.lastname@example.org:password https://www.example.com
Returns the following error
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://mail.google.com/mail/">here</A>. </BODY></HTML> badauth
after downloading the
cacert.crtfile from here
Then renamed the
curl --cacert /path/to/cacert.pem email@example.com:password https://www.example.com
But get the same error.
I get this error
curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option
So I tried with
curl -k https://www.example.com
But of course get the error
I'm guessing I'm doing something wrong with the certificate file but I don't know where to get a certificate file or what to do with it once I have it.
I have no problem logging in using a browser of course but I'd like to automate the process with the command line so I can do this with tasker on my Android tablet over WiFi.