crypto/x509 supports dNSName name constraints which contain a leading period (i.e. .example.com), which are only valid for URIs per RFC 5280 (a comment in matchDomainConstraint notes this, but implements it anyway). Per #16347 this seems to have mainly been implemented to maintain compatibility with OpenSSL and NSS, which allow these malformed constraints.
The current behavior in Certificate.Verify matches validation of URI constraints, requiring one or more labels to be appended to the name when a leading period is present. Given this is unspecified behavior, per 5280, this should be at least documented somewhere. Depending on the efforts to clarify this behavior (see https://www.rfc-editor.org/errata/eid5997) it may make sense to deprecate support for these constraints altogether (while I'm not sure about prevalence of this misuse in internal PKIs, these constraints are not allowed in the public web PKI).
crypto/x509supports dNSName name constraints which contain a leading period (i.e..example.com), which are only valid for URIs per RFC 5280 (a comment inmatchDomainConstraintnotes this, but implements it anyway). Per #16347 this seems to have mainly been implemented to maintain compatibility with OpenSSL and NSS, which allow these malformed constraints.The current behavior in
Certificate.Verifymatches validation of URI constraints, requiring one or more labels to be appended to the name when a leading period is present. Given this is unspecified behavior, per 5280, this should be at least documented somewhere. Depending on the efforts to clarify this behavior (see https://www.rfc-editor.org/errata/eid5997) it may make sense to deprecate support for these constraints altogether (while I'm not sure about prevalence of this misuse in internal PKIs, these constraints are not allowed in the public web PKI).