Handle externally-generated CSRs that have no attributes#317
Conversation
Owner
|
Ooh, nice! Thanks @methorpe. Would it be possible to add an example CSR with no attributes into the |
…t case A similar CSR can be generated as follows: openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out rsa-2048-onlyCN-no-attrs.pem openssl req -new -key rsa-2048-onlyCN-no-attrs.pem -out rsa-2048-onlyCN-no-attrs.csr -subj "/CN=example.com"
Author
|
Hi Ryan!
It's very good of you to respond so quickly -- thank you!
I've uploaded an example CSR and test case. I've never used Pester before so that was a good learning experience. The commit message has notes on how to regenerate the CSR if desired.
Many thanks, and best wishes,
Martin
… On 4 Feb 2021, at 16:37, Ryan Bolger ***@***.***> wrote:
Ooh, nice! Thanks @methorpe <https://github.com/methorpe>. Would it be possible to add an example CSR with no attributes into the Tests\TestFiles folder? I'd like to add a test for this in the Pester tests, but I'm not sure how to generate one specifically like this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#317 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ASXH2OLZYOJCBYTTCA7SOULS5LEN3ANCNFSM4XC2G3WQ>.
|
Owner
|
Perfect! Thanks a ton. You are awesome. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Ryan,
I've made a small patch to Get-CsrDetails so that it can handle CSRs that have no attributes, such as if there were no SANs in the CSR. Get-CsrDetails already handles CSRs that have a CN and non-SAN attributes but no SANs, so it was just the no-attributes-at-all case that it didn't like.
Of course it would be good if every program that generated CSRs automatically added the CN as a SAN, but for those that don't and which need to generate the private key themselves (eg if it's generated and stored in a hardware security module) this will allow Posh-ACME to be used to submit their CSRs.
Thanks!
Martin