Skip to content

common_name field should be optional #369

@sed-i

Description

@sed-i

Currently, we must provide a common_name,

@dataclass(frozen=True)
class CertificateRequestAttributes:
"""A representation of the certificate request attributes.
This class should be used inside the requirer charm to specify the requested
attributes for the certificate.
"""
common_name: str
sans_dns: Optional[FrozenSet[str]] = frozenset()

However, that field is deprecated and the best practice is to not have it included.
https://github.com/cabforum/servercert/blob/90a98dc7c1131eaab01af411968aa7330d315b9b/docs/BR.md#71272-domain-validated

If it is included, it must be derived from the SANs, but CN is limited to 64 chars,
https://community.letsencrypt.org/t/simplifying-issuance-for-very-long-domain-names/207924

Seems like we have two options:

  1. Allow for it to be excluded, or automatically exclude it from the CSR if set to an empty string ("") in the dataclass.
  2. Keep it as is, but pass a wildcard such as *.svc.cluster.local.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions