Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subject_alt_names kwarg to Cert.generate #463

Closed

Conversation

moozzi
Copy link
Member

@moozzi moozzi commented Nov 23, 2023

Copy link
Member

@postmodern postmodern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think subject_alt_names should accept an Array of IP or hostname Strings, and have them be mapped to "DNS:..." or "IP:...".

@@ -356,6 +357,11 @@ def self.generate(version: 2,
else cert.subject
end

if subject_alt_names
extensions ||= {}
extensions = extensions.merge('subjectAltName' => subject_alt_names.join(', '))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, depends if we want to accept raw subject-alt-name values or IP/hostname Strings. If we accept IP/hostname strings, then we'd want to check if the string is an IP address, and map it to either "DNS:#{value}" or "IP:#{value}".

Copy link
Member

@postmodern postmodern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be rebased off of the 1.1.0 branch. New features should always go into a the next minor version branch.

@moozzi moozzi changed the base branch from main to 1.1.0 November 27, 2023 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants