Friday, June 3, 2022

[SOLVED] cacert option and process substitution

Issue

When I do

$ curl ... --cacert <(cat intermediate1.pem intermediate2.pem root.pem) ...

I see the error:

* NSS error -5978
* Closing connection #0
* Problem with the SSL CA cert (path? access rights?)
curl: (77) Problem with the SSL CA cert (path? access rights?)

So first I have to do:

$ cat intermediate1.pem intermediate2.pem root.pem >ca.pem

and then I can do

$ curl ... --cacert ca.pem ...

But why does --cacert <(cat ...) does not work? I can use <(cat ...) with the comm command for example in the same manner.


Solution

Actually this problem depends on the version of curl.

Here's a commit that added support for FIFO (which is a bash process substitution) in the --cert flag.

So, according to tags in curl repo, this problem present in library until curl-7.65 version.



Answered By - SergA
Answer Checked By - Candace Johnson (WPSolving Volunteer)