Skip to main content

POST /api/domain/complete-certificate/

Completes the Let’s Encrypt certificate request after the user has added the TXT record. This is Step 2 of the SSL flow.

Purpose

This endpoint:
  1. Validates the DNS challenge with Let’s Encrypt
  2. Issues the SSL certificate
  3. Imports the certificate to AWS ACM
  4. Attaches the certificate to CloudFront

Architecture

Internal Services

complete_certificate_request

Responds to the ACME challenge and retrieves the issued certificate. Location: src/app/apis/domain/shared/letsencrypt/certificate_service.py

attach_certificate_to_cloudfront

Updates the CloudFront distribution to use the new SSL certificate. Location: src/app/apis/domain/shared/letsencrypt/certificate_service.py

DNS Precheck

Before attempting the ACME challenge, the endpoint performs a best-effort DNS lookup against:
  • Cloudflare DNS (1.1.1.1)
  • Google DNS (8.8.8.8)
This helps catch DNS propagation issues early.

Response Fields

FieldTypeDescription
statusstring”success” or error
proxy_statusstringUpdated to β€œSSL_VALIDATED”
certificate_arnstringACM certificate ARN
messagestringHuman-readable status message

Code Location

src/app/apis/domain/complete_certificate/routes.py