How to download using curl client authentication?

Instead of using basic or digest authentication for downloads, can the service create a certificate for the client to download for authenticated downloads? Keygen can be used, for example, although it would be easier to "Save Certificate".

After the user has a certificate, the user can then download "foobar.png" via cURL. Perhaps so:

curl -E mycert.pem -F "fileupload=@foobar.png" http://example.com/secure-upload.php

Does anyone set up a similar circuit? I'm not sure if this is possible, since the switch -Ein the man page does not mention POST. Also I do not know how to configure the httpd service for certificate authentication. Hope this is just an Apache SSL directive .

+3
source share
1 answer

Yes it is possible. -E works with any HTTP method. Of course you need to use https: // url.

You also need to provide a passphrase, and you need to find out that -E accepts the private key and the private certificate concatenated (usually as indicated on the manual page).

The server side with Apache just follows the documents, yes.

+4
source

Source: https://habr.com/ru/post/1709072/


All Articles