Joined August 2017
·

doom

Systems Architect
·
Helsinki
·
·
·

Posted to Securely use basic auth with curl over 1 year ago

After a careful read of man curl, it appears that this might actually be the best way:
curl -K curlconfig.cfg http://www.googles

Then you insert this line to curlconfig.cfg (or what ever filename you like):
user = "defn:password"

Works like a charm. Also, you can add other curl options to that file as well as separate lines.

Posted to Securely use basic auth with curl over 1 year ago

Thank you for these tips!
The reason the example with cat is not working as it is, is that cat prints out a newline from the file.
By removing the newline, the code will work:
{ echo -n 'user = "'; cat password.txt | tr -d '\n'; echo '"'; }
tr -d '\n' deletes the newline from the (end of the) data.

Achievements
1 Karma
0 Total ProTip Views