Closed mpeylo closed 5 years ago
When do host names start with a digit? I thought this is not legal for DNS names, but it is indeed allowed - see e.g. https://serverfault.com/questions/638260/is-it-valid-for-a-hostname-to-start-with-a-digit
So far, -sans interpreted its input as an IP address when it starts with a digit, and if this option is removed as currently suggested, the help text
"Subject Alternative Name(s) (DNS/IPADDR) to add as cert request extension"
needs to be adapted.
As suggested in the above reference, a solution would be to parse the whole input string and see if it is of the form #.#.#.#
and in this case use GEN_IPADD
. What should also work is to try this type first when calling a2i_GENERAL_NAME()
and to switch to GEN_DNS
on failure of the first call.
you realize that this is a pull request?
Ok
By having a look at the context I've just realized that the latter solution is what I already implemented earlier and your changes where actually already sufficient :) So I'll just cherry-pick your commit.
See RFC 1123, October 1989
Checklist