@@ -770,23 +770,25 @@ Following are some global settings that control various aspects of this feature.
770770
771771.. cssclass :: table-striped table-bordered table-hover
772772
773- ======================================= ====================================================================
773+ ======================================= ====================================================================================================
774774Global setting Description
775- ======================================= ====================================================================
775+ ======================================= ====================================================================================================
776776ca.framework.provider.plugin The configured CA provider plugin
777777ca.framework.cert.keysize The key size used for certificate generation
778778ca.framework.cert.signature.algorithm The certificate signature algorithm
779779ca.framework.cert.validity.period Certificate validity in days
780780ca.framework.cert.automatic.renewal Whether to auto-renew expiring certificate on hosts
781781ca.framework.background.task.delay The delay between each CA background task round in seconds
782782ca.framework.cert.expiry.alert.period The number of days to check and alert expiring certificates
783- ca.plugin.root.private.key (hidden/encrypted in database) Auto-generated CA private key
784- ca.plugin.root.public.key (hidden/encrypted in database ) CA public key
785- ca.plugin.root.ca.certificate (hidden/encrypted in database ) CA certificate
786- ca.plugin.root.issuer.dn The CA issue distinguished name used by the root CA provider
783+ ca.plugin.root.private.key (hidden) CA private key. Auto-generated if empty. PKCS#8 format required
784+ ca.plugin.root.public.key (hidden) CA public key. Auto-generated if empty. X.509/SPKI format required
785+ ca.plugin.root.ca.certificate (hidden) CA certificate chain. Auto-generated if empty. Supports intermediate CA chains
786+ ca.plugin.root.issuer.dn The CA issuer distinguished name used by the root CA provider
787787ca.plugin.root.auth.strictness Setting to enforce two-way SSL authentication and trust validation
788788ca.plugin.root.allow.expired.cert Setting to allow clients with expired certificates
789- ======================================= ====================================================================
789+ ca.framework.inject.default.truststore Injects CA certificate into JVM default truststore on startup for outgoing HTTPS trust
790+ (default: ``true ``). Restart management server(s) when changed
791+ ======================================= ====================================================================================================
790792
791793A change in ``ca.framework.background.task.delay `` settings requires restarting of
792794management server(s) as the thread pool and a background tasks are configured
@@ -806,6 +808,76 @@ enforce authentication and validation strictness by setting
806808``ca.plugin.root.auth.strictness `` to ``true `` and restarting the management
807809server(s).
808810
811+ Custom CA Support
812+ ~~~~~~~~~~~~~~~~~~
813+
814+ The built-in ``root `` CA provider supports user-provided CA
815+ material. When the ``ca.plugin.root.private.key ``,
816+ ``ca.plugin.root.public.key ``, and ``ca.plugin.root.ca.certificate ``
817+ configuration keys are pre-populated, CloudStack uses the provided CA instead
818+ of auto-generating one. All internal certificate provisioning (agents,
819+ SystemVMs, management server keystores) automatically use the configured CA.
820+
821+ Starting 4.23, this support was enhanced to include:
822+
823+ - **Intermediate CA chains **: The ``ca.plugin.root.ca.certificate `` key can now
824+ contain a PEM-concatenated chain of certificates.
825+ - **Outgoing HTTPS trust **: The configured CA is injected into the management
826+ server's default truststore (controlled by ``ca.framework.inject.default.truststore ``)
827+ and the SystemVM's truststore, allowing outgoing HTTPS connections to trust
828+ servers using this CA. This enables SystemVMs to download templates and ISOs
829+ from HTTPS servers whose certificates are signed by the configured CA.
830+ - **Validation **: User-provided keys are validated on startup to prevent silent
831+ overwriting of malformed keys.
832+
833+ All three keys must be set together. If any key is missing or malformed, the CA
834+ provider will log a warning, overwrite them with auto-generated keys, and
835+ the user will need to update the global settings again with valid values.
836+ The private key must be in PKCS#8 format and the public key must be explicitly
837+ extracted. Use the following commands to prepare the CA material:
838+
839+ .. code :: bash
840+
841+ # Convert private key to PKCS#8 format (required)
842+ openssl pkcs8 -topk8 -nocrypt -in ca.key -out ca-pkcs8.key
843+
844+ # Extract the public key
845+ openssl rsa -in ca.key -pubout -out ca.pub
846+
847+ # For intermediate CAs, concatenate into a single PEM chain
848+ cat intermediate.crt root.crt > ca-chain.crt
849+
850+ .. note ::
851+ When migrating from one CA to another on an existing environment, agents
852+ holding certificates signed by the old CA will fail to connect after the
853+ management server restarts with the new CA. Ensure
854+ ``ca.plugin.root.auth.strictness `` is set to ``false `` to allow agents to
855+ reconnect, then use ``provisionCertificate `` to re-provision each host and
856+ SystemVM with certificates signed by the new CA. Alternatively, use forced
857+ provisionin (see below) for hosts that cannot reconnect.
858+
859+ Forced Certificate Provisioning
860+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
861+
862+ The ``provisionCertificate `` API accepts a ``forced `` parameter (default:
863+ ``false ``). When set to ``true ``, the management server provisions certificates
864+ directly via SSH instead of the agent communication channel. This is required
865+ when agents cannot connect to the management server — for example, after a CA
866+ change when the agent's keystore trusts the old CA.
867+
868+ For KVM hosts, forced provisioning connects via SSH using stored host
869+ credentials, provisions the certificate, and restarts the ``cloudstack-agent ``
870+ and ``libvirtd `` services. For SystemVMs, it routes commands through the
871+ SystemVM's SSH access.
872+
873+ .. code :: bash
874+
875+ # Force re-provision a disconnected KVM host
876+ cmk provision certificate hostid=< HOST_UUID> reconnect=true forced=true
877+
878+ # Force re-provision a disconnected SystemVM
879+ cmk provision certificate hostid=< SYSTEMVM_HOST_UUID> reconnect=true forced=true
880+
809881 Server Address Usage
810882--------------------
811883
0 commit comments