• Logo
    Certificate Management
  • documentation.ubuntu.com
  • More resources
    • Discourse
    • Matrix
    • GitHub
Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Certificate Management documentation
Certificate Management documentation

For Charm Developers

  • Tutorials
    • Getting Started with the TLS Certificates Library (v4)
  • How-to guides
    • Testing your requirer charm
  • Reference
    • The tls-certificates library
    • TLS Certificates Interface Library Versions
    • Important Update: New Labels for Juju Secrets
    • Recommended Juju Configuration Options for TLS Requirers
  • Explanation
    • Do I need to implement the TLS library?
    • Common Name and SANs Attributes
    • Certificate Renewal with the TLS Certificates Library v4
    • Differences between TLS Certificates Library v3 and v4
    • Security Explanation in TLS Certificates Interface

For Charm Operators

  • Tutorials
  • Reference
    • Deployment blueprints
      • Multi-model TLS reference architecture
  • Explanation
    • Understanding TLS in Juju deployments
    • Securing internal communication
    • Securing API communication
    • CA trust best practices
Back to top

Recommended Juju Configuration Options for TLS RequirersΒΆ

For charms that expose public HTTPS endpoints, certificate attributes should be decided at deployment time by users. Therefore, we recommend to have the following Juju configuration options:

  • common_name

  • sans_dns

  • organization

  • organizational_unit

  • email_address

  • country_name

  • state_or_province_name

  • locality_name

The charm should use those values when instantiating and create the appropriate CertificateRequest object from those.

class TLSRequirerExample(ops.CharmBase):

	def __init__(self, framework: ops.Framework):
		super().__init__(framework)
		self.certificates = TLSCertificatesRequiresV4(
			charm=self,
			relationship_name="certificates",
			certificate_requests=[self._get_certificate_request()],
			mode=Mode.UNIT,
		)

	def _get_certificate_request(self) -> CertificateRequest:
		return CertificateRequest(
			common_name=self._get_config_common_name(),
			sans_dns=self._get_sans_dns(),
			organization=self._get_config_organization(),
			organizational_unit=self._get_config_organizational_unit(),
			email_address=self._get_config_email_address(),
			country_name=self._get_config_country_name(),
			state_or_province_name=self._get_config_state_or_province_name(),
			locality_name=self._get_config_locality_name(),
		)

	def _get_config_common_name(self) -> str:
		return self.model.config["common-name"]

	def _get_sans_dns(self) -> Optional[list[str]]:
		return self.model.config.get("sans-dns")

	def _get_config_organization(self) -> str:
		return self.model.config["organization"]

	def _get_config_organizational_unit(self) -> str:
		return self.model.config["organizational-unit"]

	def _get_config_email_address(self) -> str:
		return self.model.config["email-address"]

	def _get_config_country_name(self) -> str:
		return self.model.config["country-name"]

	def _get_config_state_or_province_name(self) -> str:
		return self.model.config["state-or-province-name"]

	def _get_config_locality_name(self) -> str:
		return self.model.config["locality-name"]
Next
Explanation
Previous
Important Update: New Labels for Juju Secrets
© 2026 CC-BY-SA, Canonical Ltd.
Last updated on Apr 21, 2026
Contents
  • Recommended Juju Configuration Options for TLS Requirers