mirror of
https://github.com/certera-io/certera.git
synced 2026-04-25 11:15:55 +03:00
[GH-ISSUE #3] Unbundle certificate? #1
Labels
No labels
bug
feature-request
feature-request
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/certera#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @carloscarnero on GitHub (May 1, 2020).
Original GitHub issue: https://github.com/certera-io/certera/issues/3
Currently testing this awesome project, and got to the point where I got the certificate for the certera instance. While testing the process of getting that certificate from a remote node (using
curl) for further deployment, the file I got seems to include the full certificate chain.Currently, the endpoint I'm hitting, as per the documentation, is
/api/certificate/<certificate_name>. Is there another endpoint for the unbundled certificate? If not, how about another parameter, likebundled=true|false? By defaulttrueto avoid breakage.In the same vein, how about yet another parameter,
chain=false|true, that would allow to download just the chain (or, if the chain is the same for any certificate, another endpoint altogether.)Why the above? I deploy certificates in dissimilar systems: Apache, Nginx, Icecast, and many more. Each of them have different semantics for injecting the certs: some like the bundles, others separated (Icecast even wants to have the certificate, chain and key in a single file.) So, having the option of getting all those components separately would make certera more versatile, IMO.
@certeraio commented on GitHub (May 1, 2020):
Hi @carloscarnero! Thanks for the input and feedback. Greatly appreciated.
You certainly are correct that it would be more versatile. Today, the certificates endpoint returns the chain, which may not be what people want. Let me do some research on the best way to get just the certificate for the subject requested. I like the idea of the backwards compatible bundle parameter.
As for combining the key, it should be trivial to concatenate that after retrieving via curl, right?
After obtaining the certificate (whether bundled, i.e. whole chain, or single), you can do
cat key.pem cert.pem > combined.pem
@certeraio commented on GitHub (May 4, 2020):
Hi @carloscarnero. I've created a new release, version 2.0.2 that contains the
chainparameter. The default istrue(or don't specify the parameter at all) and the chain is returned (same as what it has always done). Whenchain=false, only a single certificate is returned.https://github.com/certera-io/certera/releases/tag/2.0.2-beta
@carloscarnero commented on GitHub (May 4, 2020):
I confirm that this works!
However, I seem to missunderstand the documentation, in particular passing the query string parameters. The example shows
But I think that
-dsends the data in aPOSTrequest.Adding the parameters to the URL works as expected or, alternatively, including the
-Gparameter that forces the request to be aGET. So I think the above block of documentation should beEDIT: I took the liberty of creating a pull request at certera-io/docs#1 that includes the
-Gparameter. Not sure if its OK, but... YOLO.@certeraio commented on GitHub (May 5, 2020):
Hi @carloscarnero
You are correct. I missed that parameter. Thanks for catching that. I had read this on my phone and fixed it before seeing your edit and PR. Thanks for submitting the PR, but I have closed it since I had previously fixed it!