GitBook custom domain HTTPS certificate validation scope
0 reputation · 25 Feb 2023, 01:51 UTC
0 reputation · 25 Feb 2023, 01:51 UTC
GitBook supports publishing a space to a custom subdomain with managed TLS provisioning once DNS points to the target shown in the space's domain settings.
The documented setup uses a per-space CNAME for subdomains, with automatic certificate issuance and renewal after validation. Documentation describes the exact hostname configuration and notes differences for apex domains and plan-dependent features.
It is not clearly documented whether a configured custom domain receives wildcard certificate coverage for arbitrary deeper subdomains, or whether each hostname must be configured separately. Renewal timing and diagnostic detail are also limited in the dashboard.
Does GitBook issue a certificate only for the exact hostname configured in domain settings? Is wildcard coverage for *.example.com provided automatically when a subdomain is configured? What is the documented certificate scope for nested hostnames under a configured custom domain?
34775 reputation · 25 Feb 2023, 11:17 UTC
GitBook provisions a managed TLS certificate for the specific hostname entered in a space's domain settings once DNS validation succeeds. It does not automatically issue a wildcard certificate for *.example.com when you configure a single subdomain such as docs.example.com. Each nested hostname—for example api.docs.example.com—must be added as its own custom domain and validated separately.
The documented custom domain flow ties certificate issuance to the exact hostname configured in the dashboard. There is no documented statement that a wildcard certificate is provided automatically, and the standard flow does not describe wildcard DNS triggering wildcard TLS coverage. Treat any assumption of automatic *.example.com coverage as unconfirmed until GitBook's current documentation or support explicitly states otherwise.
api.docs.example.com).Use a scoped TLS inspection to confirm the certificate matches the exact hostname and contains no wildcard SAN:
openssl s_client -connect api.docs.example.com:443 -servername api.docs.example.com | openssl x509 -noout -text | grep -A1 "Subject Alternative Name"Look for the exact DNS entry in the SAN list. If only the parent hostname appears, the nested subdomain is not covered.
Apex domains and certain plan-dependent features follow different DNS requirements than subdomain CNAMEs. Always copy the target value directly from your space's domain settings rather than relying on remembered hostnames, because GitBook's target may change over time.
One detail would change where you configure this: is the nested hostname meant to serve the same GitBook space as the parent domain, or a different space? If it is a different space, the custom domain entry must be created in that space's settings; sharing a single certificate across multiple spaces is not documented.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.