The ACME (Automatic Certificate Management Environment) issuance subsystem is the core component responsible for automating the lifecycle of SSL/TLS certificates. It handles interactions with Certificate Authorities (CAs), manages domain validation challenges (DNS-01 and HTTP-01), and supports advanced features like External Account Binding (EAB) and ACME Renewal Information (ARI).
The issuance process is primarily driven by the bizApply node within the workflow engine. This node utilizes the internal/certacme package to interface with the lego library. To ensure system stability and credential isolation, Certimate can execute these requests in an isolated process via the intercmd certapply command using a specialized IPC mechanism, controlled by the CERTIMATE_WORKFLOW_MULTIPROC environment variable internal/workflow/engine/executor_bizapply.go27-31
This diagram illustrates the flow from a workflow execution to the final certificate storage, mapping high-level actions to specific code entities and packages.
Sources: internal/workflow/engine/executor_bizapply.go62-139 internal/certacme/client_obtain.go72-196 internal/repository/certificate.go77-126
Certimate supports multiple CAs through the lego client. The CA configuration is resolved from the SettingsContentForSSLProvider or node-specific overrides.
| CA Provider | EAB Support | Entity Reference |
|---|---|---|
| Let's Encrypt | No | CAProviderTypeLetsEncrypt |
| ZeroSSL | Yes | CAProviderTypeZeroSSL |
| Google Trust Services | Yes | CAProviderTypeGoogle |
| SSL.com | Yes | CAProviderTypeSSLCom |
| Actalis | Yes | CAProviderTypeActalis |
| DigiCert | Yes | CAProviderTypeDigiCert |
| GlobalSign Atlas | Yes | CAProviderTypeGlobalSign |
| Sectigo | Yes | CAProviderTypeSectigo |
| LiteSSL | Yes | CAProviderTypeLiteSSL |
Configuration Logic:
The bizApplyNodeExecutor retrieves global CA settings via settingsRepo.GetByName(SettingsNameSSLProvider). If EAB (External Account Binding) is required, the credentials (KID and HMAC Key) are provided to the ACME client to register or look up the ACMEAccount internal/certacme/account.go70-88 ACME account resources are persisted in the database with the resourceObj field containing the acme.Account JSON internal/repository/acme_account.go95-98
Sources: internal/certacme/account.go26-107 internal/repository/acme_account.go90-114
Certimate implements two primary ACME challenge types, leveraging the lego library's provider ecosystem through a registry pattern.
This method supports wildcard certificates by creating TXT records. Certimate integrates over 80 providers via ACMEDns01Registries.
internal/certacme/certifiers. Each factory function maps AccessConfig to a core.ACMEChallenger (which wraps challenge.Provider) internal/certacme/certifiers/sp_googlecloud_dns.go13-26ecloudsdkclouddns to manage TXT records with configurable propagation timeouts and polling intervals pkg/core/certifier/challengers/dns01/cmcccloud/internal/lego.go97-133Used when DNS control is restricted. Supported via ACMEHttp01Registries.
ObtainCertificateRequest.ChallengeType = "http-01" internal/certacme/client_obtain.go114-131Sources: internal/certacme/client_obtain.go81-136 pkg/core/certifier/challengers/http01/ssh/ssh.go11-30 internal/certacme/certifiers/sp_googlecloud_dns.go12-29
Certimate supports the ACME Renewal Information (ARI) extension to optimize certificate replacement.
lastCertificate exists, its ACMECertificateUrl is passed as ReplacesCertID to the ACME request internal/certacme/client_obtain.go148-159AlreadyReplacedError, Certimate automatically retries the request without the ARI extension to ensure issuance proceeds internal/certacme/client_obtain.go161-175IsRenewed flag is updated on the previous certificate record internal/workflow/engine/executor_bizapply.go128-131Sources: internal/certacme/client_obtain.go158-175 internal/workflow/engine/executor_bizapply.go128-131
To prevent long-running ACME operations or provider SDK crashes from affecting the main workflow engine, Certimate uses internal/tools/mproc for process isolation.
CERTIMATE_WORKFLOW_MULTIPROC environment variable internal/workflow/engine/executor_bizapply.go30bizApply node invokes intercmd certapply. This subprocess initializes a mproc.Receiver to consume the encrypted ACME request, executes ObtainCertificate, and returns the certificate data via an encrypted response file internal/workflow/engine/executor_bizapply.go21-31xcert.ConvertPrivateKeyToPEM internal/certacme/client_obtain.go177-184Sources: internal/workflow/engine/executor_bizapply.go27-31 internal/certacme/client_obtain.go177-184
This diagram maps the code entities involved in the ACME lifecycle to their roles in the system.
Sources: internal/domain/certificate.go18-43 internal/repository/acme_account.go90-114 internal/certacme/client_obtain.go26-59 internal/repository/certificate.go15-25
Refresh this wiki