User Tools
Writing /app/www/public/data/meta/databaseandnetworkmanagement/ssl_configuration.meta failed
databaseandnetworkmanagement:ssl_configuration
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| databaseandnetworkmanagement:ssl_configuration [2017/11/23 09:25] – adowling | databaseandnetworkmanagement:ssl_configuration [2022/06/14 10:56] (current) – 10.91.110.100 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== SSL Configuration ====== | ||
| + | |||
| + | Author: Anna Dowling | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | The following wiki entry will step through the loading of a customers CA cert and bundle cert file into apache and java. | ||
| + | |||
| + | ===== CSR Generation ===== | ||
| + | |||
| + | Before you can order an SSL Certificate, | ||
| + | |||
| + | A CSR is an encoded file that provides you with a standardized way to send your public key along with some information that identifies your company and domain name. When you generate a CSR, most server software asks for the following information: | ||
| + | |||
| + | **The command to generate a server key and csr file is as follows:** | ||
| + | < | ||
| + | * openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr -config san.conf | ||
| + | </ | ||
| + | |||
| + | This will generate a new key so should only be performed on a new server that doesn' | ||
| + | |||
| + | < | ||
| + | * $ openssl req -out yourdomain.csr -key private.key -new | ||
| + | </ | ||
| + | |||
| + | |||
| + | **Checking the csr file contains the configuration you set in san.conf (DNS example):** | ||
| + | < | ||
| + | openssl req -noout -text -in yourdomain.csr | grep DNS | ||
| + | </ | ||
| + | |||
| + | ===== Root and intermediate certs explained: ===== | ||
| + | ** Root certificate: | ||
| + | |||
| + | **Intermediate certificate: | ||
| + | However, because the root certificate itself signed the intermediate certificate, | ||
| + | |||
| + | =====Files needed for loading to apache: | ||
| + | |||
| + | - ** Server Certificate Chain(bundle) file** - CA bundle is a file that contains root and intermediate certificates. The certificate issued for your domain constitutes the certificates’ chain with a CA bundle. (This is provided by the CA authority) | ||
| + | - **Server Certificate file** - Often referred to as the sub CA, this is the certificate file containing the certified domain details for use with securing your site. (This is provided by the CA authority) | ||
| + | - **Server Private key** - The private key is generated simultaneously with the CSR (certificate signing request), containing the domain name, public key and additional contact information. The CSR is to be sent to the certificate authority for validation and signing immediately after the certificate activation typically. The private key must be kept secret, ideally on the same server the certificate will be installed on. (This is generated on the server) | ||
| + | |||
| + | ===== Update SSL Certs ===== | ||
| + | |||
| + | Pull the master branch of the [[https:// | ||
| + | |||
| + | * Load the cert into Java | ||
| + | * Load the cert into Apache | ||
| + | * Restart Apache | ||
| + | |||
| + | < | ||
| + | |||
| + | There is no need to shut down all applications anymore. | ||
| + | |||
| + | For AWS based environments, | ||
| + | |||
| + | * Sign into AWS console | ||
| + | * Navigate to Home Page | ||
| + | * Load Balancers -> Listeners -> View/Edit certificates ACM | ||
| + | * https:// | ||
| + | * Selecting certiciate relevant to environment -> Actions -> Reimport Certificate | ||
| + | * Paste in the contents of the three certificate files from env-configuration (already PEM encoded) into the corresponding fields. | ||
| + | * Certificate private key | ||
| + | * Certificate body | ||
| + | * Certificate chain | ||
| + | |||
| + | |||
| + | ===== Loading the cert into Java (Handled by Playbook) ===== | ||
| + | |||
| + | In order for the applications to obtain the certificate it must be loaded into javas list of certs via keytool. The bundle and sub cert files should both be loaded at this point. This step needs to be done on each server that is running any applications using java. The cert files should be transferred to all application servers. | ||
| + | |||
| + | If an old certificate was present on the server these should be deleted before loading the new ones to ensure that the correct cert gets used. Any java versions in use by the applications should also be taken into account when loading the certs. We may have multiple versions running apart from jdk1.7.0_80. | ||
| + | |||
| + | === Remove Key Store Aliases if already present (do not delete any default java cert aliases)=== | ||
| + | |||
| + | :-x **Examples of java default certs to not delete:** :-x | ||
| + | * GIAG2.crt | ||
| + | * aspmx.l.google.com.cert | ||
| + | * smpt.gmail.com.cert | ||
| + | * smtp-relay.gmail.com.cert | ||
| + | |||
| + | |||
| + | < | ||
| + | * / | ||
| + | * / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ** Load in new certs (files mentioned are examples :!:): ** | ||
| + | < | ||
| + | * / | ||
| + | * / | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Verify that new certs are present in the keystore === | ||
| + | < | ||
| + | * / | ||
| + | * / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Load the cert into Apache (Handled by Playbook) ===== | ||
| + | |||
| + | **Transfer the cert files(bundle file, cert and server key) to the load balancer into the following directory: | ||
| + | < | ||
| + | * / | ||
| + | </ | ||
| + | |||
| + | **Edit the ssl.conf file located in:** | ||
| + | < | ||
| + | * / | ||
| + | </ | ||
| + | |||
| + | **Update the following sections to point to the files that you transferred to the server (files mentioned are examples :!:):** | ||
| + | < | ||
| + | * SSLCertificateFile / | ||
| + | * SSLCertificateKeyFile / | ||
| + | * SSLCertificateChainFile / | ||
| + | </ | ||
| + | |||
| + | ===== New Domain Name requirements ===== | ||
| + | * If a new domain name has been provided for a system by the customer, this name should be reflected in the following places before doing a restart: | ||
| + | * Grails Application Config files | ||
| + | * cas.properties file | ||
| + | * Database configuration domains | ||
| + | |||
| + | |||
| + | ===== Restart Applications and Apache (Handled by Playbook) ===== | ||
| + | **Applications do not need a restart anymore when using the reconfigure_ssl playbook, only the httpd service needs a restart** | ||
| + | - Shutdown all applications | ||
| + | - Restart apache service on the load balancer: | ||
| + | < | ||
| + | * sudo service httpd restart | ||
| + | </ | ||
| + | - Restart all applications (This is in order to load the new certs from keystore) | ||
| + | |||
| + | ===== Troubleshooting SSL ===== | ||
| + | **Check for other keystores present on the servers and delete if necessary: | ||
| + | < | ||
| + | * cd / | ||
| + | * sudo find . -name .keystore | ||
| + | </ | ||
| + | |||
| + | **The correct keystore should point to the java cacerts file:** | ||
| + | < | ||
| + | * / | ||
| + | </ | ||
| + | |||
| + | **Ensure the correct JAVA_HOME is set to the correct version as this can impact the keystore:** | ||
| + | < | ||
| + | * readlink -f / | ||
| + | * sudo unlink / | ||
| + | * sudo ln -s / | ||
| + | </ | ||
| + | |||
| + | **Clear out any unused certs from the java keystore, | ||
| + | < | ||
| + | * / | ||
| + | </ | ||
| + | |||
| + | **Check the ssl error logs on the server:** | ||
| + | < | ||
| + | * sudo vi / | ||
| + | </ | ||
| + | |||
| + | **Check that the domain name and public ip address resolve to the correct cert:** | ||
| + | < | ||
| + | * openssl s_client -connect 12.39.4.41: | ||
| + | * openssl s_client -connect extenetqa.errigal.com: | ||
| + | * If either of these evaluate to a previous cert it is possible that the cert is being cached by the firewall and may need to be reset by a sysadmin. | ||
| + | </ | ||
| + | |||
| + | **Check that the private key matches the cert using the following tool:** | ||
| + | https:// | ||
| + | |||
| + | |||
| + | |||
| + | --- // | ||
| + | |||
| + | |||