Overview
Although auto-generated global.yaml template has "HTTPS enabled" by default, in our sample scenario and configuration it was "HTTPS disabled" to keep it simple to understand. Refer here for sample configuration told at installation.
SSL configuration has some specific details for its own use cases and it should have a dedicated section.
So, in this section we will document all the details about configuring HTTPS with your own certificates for your own domain.
Self-hosted Appcircle server does not support using a proxy, load balancer or some other external device to terminate SSL. You should do it inside Appcircle instance with configuration told in below sections.
For now, self-hosted Appcircle server does not have Let’s Encrypt integration or an automated way of renewing certificates.
You should manage certificates from configuration file manually and renew them with same method when expired.
If your cert format PKCS#7 (known as p7b or p7c) , you can convert it to pem format with openssl.
See the example command below:
openssl pkcs7 -print_certs -in cert.p7b -out cert.pem
If your cert format is PFX (known as p12), you can convert it to pem format with openssl.
See the example commands below:
- Extract the cert from archive.
openssl pkcs12 -in cert.p12 -clcerts -nokeys -out cert.pem
- Extract the key without password.
openssl pkcs12 -in cert.p12 -nocerts -nodes -out key.pem
- Extract the key with password.
openssl pkcs12 -in cert.p12 -nocerts -out key.pem
When configuring Appcircle with HTTPS, you have the option to use self-signed or untrusted root certificates. However, if you choose to do so, it is essential to add the certificate or the root CA certificate to the trusted certificates. Failure to do this may result in connection errors. For detailed instructions about adding trusted CA certificates, refer to the External Services section.
Configure HTTPS
First of all, you need to set external.scheme as https at global.yaml to enable HTTPS for all subdomains.
external:
scheme: https
global.yaml configuration file is located under project folder.
projects/${YOUR_PROJECT}
You can see an example project configuration from here.
Changing external.scheme from http to https or from https to http after using Appcircle server some time, requires configuration reset which results with data cleanup.
So, we suggest you to be sure with your configuration before using it in production environment.
Refer to reset configuration section for more details.
Set your private key and public certificate to nginx environment variables in global.yaml as below.
nginx:
sslCertificate: |
-----BEGIN CERTIFICATE-----
MIIFLTCCBBWgAwIBAgISBB5v1NxtkwmxzOryHdHkWuwoMA0GCSqGSIb3DQEBCwUA
MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD
...
Dfvp7OOGAN6dEOM4+qR9sdjoSYKEBpsr6GtPAQw4dy753ec5
-----END CERTIFICATE-----
sslCertificateKey: |
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDWkSbzuxqDY9hb
giZbOvH6ZEWJNgk5x+jsocsH+f2nsi6IsmnZqm5z068IxV4o7u2NtPQ1Yl4v4F7y
...
J8lYxh0PCOmuCZ02FAvoi0r8
-----END PRIVATE KEY-----
sslCertificateis the public certificate. (content of.crtfile)sslCertificateKeyis the private key. (content of.keyfile)
You must use the full certificate chain, in the correct order, to prevent SSL errors when clients connect. For example, you may get an "unable to verify the first certificate" error on a missing case.
Order should be like this: first the server certificate, then all intermediate certificates, and finally the root CA.
If you want to hide these secrets from human-readable global.yaml, you can use base64 encoded user-secret file for the same environment variables.
Refer to installation docs for details of user-secret usage.
For now, self-hosted Appcircle does not support usage of password protected private keys.