Skip to content

Commit b30afc8

Browse files
committed
customcertificates: update notes
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 1b8f2ca commit b30afc8

File tree

1 file changed

+84
-23
lines changed

1 file changed

+84
-23
lines changed

source/adminguide/systemvm.rst

Lines changed: 84 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -382,40 +382,101 @@ The Management Server generates URLs of the form
382382
The new console requests will be served with the new DNS domain name,
383383
certificate, and key.
384384

385-
Uploading ROOT CA and Intermediate CA
386-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
387-
If you need to upload custom certificate with ROOT CA and intermediate CA, you can find more details here:
385+
Uploading Custom Certificates
386+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
387+
388+
Custom certificates for system VMs (SSVM and CPVM) can be uploaded using
389+
UI or API.
390+
391+
To upload custom certificates following details will be needed:
392+
393+
- ROOT CA certificate
394+
- Intermediate CA certificate(s) (if any)
395+
- Site or server certificate
396+
- Private key (in PKCS8 format)
397+
- Domain name suffix
398+
399+
To upload custom certificates using UI, go to Infrastructure -> SSL
400+
Certificates. This will open up the following form.
401+
402+
|ssl-certificates.png|
403+
404+
Root Certificate, Server Certificate, PKCS#8 private certificate can be
405+
added in the straightforward way.
406+
If there are Intermediate CA certificate(s), then add them one by one
407+
using the `Add intermediate certificate` button.
408+
For DNS domain suffix, you may use a wildcard domain name like
409+
`*.yourdomain.com`.
410+
Clicking on Submit will add certificate entries in the database,
411+
one for ROOT certificate, as many Intermediate certificates as added and one for
412+
server + private certificate.
413+
414+
415+
This can also be achieved using the API `uploadCustomCertificate`. Example
416+
API calls:
417+
418+
.. code::
419+
420+
uploadCustomCertificate id=1 name='Root' certificate='-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----' domainsuffix='*.yourdomain.com'
421+
uploadCustomCertificate id=2 name='Intermediate1' certificate='-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----' domainsuffix='*.yourdomain.com'
422+
uploadCustomCertificate id=3 certificate='-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----' privatekey='-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----' domainsuffix='*.yourdomain.com'
423+
424+
Note: We do not need to provide a name for the server certificate entry, as
425+
it will auto-generate a name since the privatekey is provided.
426+
If there are multiple Intermediate certificates, then multiple API calls will
427+
be needed to upload them one by one.
428+
Also, the first two API calls for Root and Intermediate certificates can be
429+
combined in a single call by using a certificate value which consists of both
430+
Root and Intermediate certificates.
431+
432+
After successfully uploading custom certificates, CloudStack will attempt to
433+
restart all SSVMs and CPVMs. If not restarted then it can be done manually.
434+
435+
More details regarding custom certificates can be found here:
388436
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Procedure+to+Replace+realhostip.com+with+Your+Own+Domain+Name
389437

390438
IMPORTANT NOTES:
391439

392-
In order to avoid errors and problems while uploading custom certificates, please check following:
393-
394-
1. While doing URL encoding of ROOT CA and any Intermediate CA, be sure that the plus signs ("+") inside certificates
395-
are not replaced by space (" "), because some URL/string encoding tools tend to do that.
440+
In order to avoid errors and problems while uploading custom certificates,
441+
please check the following:
396442

397-
2. If you are renewing certificates it might happen you need to upload new ROOT CA and Intermediate CA, together with new Server Certificate and key.
398-
In this case please be sure to use same names for certificates during API upload of certificate, example:
443+
1. When calling the API as an HTTP request and while doing URL encoding of
444+
ROOT CA and any Intermediate CA, be sure that the plus signs ("+") inside
445+
certificates are not replaced by space (" "), because some URL/string
446+
encoding tools tend to do that.
399447

400-
http://123.123.123.123:8080/client/api?command=uploadCustomCertificate&...&name=root1...
401-
http://123.123.123.123:8080/client/api?command=uploadCustomCertificate&...&name=intermed1...
448+
2. If you are renewing certificates, you may need to upload new ROOT CA and
449+
Intermediate CA, together with new Server Certificate and key.
450+
In this case, please be sure to use the same names for certificates during
451+
API upload of the certificate, for example:
402452

403-
Here names are "root1" and "intermed1".
404-
If you used other names previously, please check the cloud.keystore table to obtain used names.
453+
.. code::
405454
406-
If you still have problems and following errors in management.log while destroying CPVM:
455+
http://123.123.123.123:8080/client/api?command=uploadCustomCertificate&...&name=root1...
456+
http://123.123.123.123:8080/client/api?command=uploadCustomCertificate&...&name=intermed1...
407457
408-
- Unable to build keystore for CPVMCertificate due to CertificateException
409-
- Cold not find and construct a valid SSL certificate
458+
Here the names are "root1" and "intermed1".
459+
If you used other names previously, please check the cloud.keystore table
460+
to obtain the used names.
410461

411-
that means that still some of the Root/intermediate/server certificates or the key is not in a good format, or incorrectly encoded or multiply Root CA/Intermediate CA present in database by mistake.
462+
If you still have problems and see the following errors in
463+
management-server.log while starting CPVM:
412464

413-
Other way to renew Certificates (Root,Intermediates,Server certificates and key) - although not recommended
414-
unless you fill comfortable - is to directly edit the database,
415-
while still respect the main requirement that the private key is PKCS8 encoded, while Root CA, Intermediate and Server certificates
416-
are still in default PEM format (no URL encoding needed here).
417-
After editing the database, please restart management server, and destroy SSVM and CPVM after that,
418-
so the new SSVM and CPVM with new certificates are created.
465+
- Unable to build keystore for CPVMCertificate due to CertificateException
466+
- Could not find and construct a valid SSL certificate
467+
468+
This means that some of the Root/Intermediate/Server certificates or the key
469+
is not in a good format, or is incorrectly encoded, or multiple Root
470+
CA/Intermediate CA entries are present in the database by mistake.
471+
472+
Another way to renew certificates (Root, Intermediates, Server certificates
473+
and key) - although not recommended unless you feel comfortable - is to
474+
directly edit the database, while still respecting the main requirement that
475+
the private key is PKCS8 encoded, while Root CA, Intermediate and Server
476+
certificates are in the default PEM format (no URL encoding needed here).
477+
After editing the database, please restart the management server, and destroy
478+
the SSVM and CPVM after that, so that new SSVM and CPVM instances with new
479+
certificates are created.
419480

420481
Load-balancing Console Proxies / Secondary Storage VMs
421482
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)