| 466 | |
| 467 | == Installing a custom certificate in the ESGF Node == |
| 468 | |
| 469 | You should own your certificate file (hostcert.crt) and your private key (hostkey.key). Your /etc/httpd/conf/esgf-httpd.conf must reference your certificate and key: |
| 470 | |
| 471 | 228 SSLVerifyClient optional |
| 472 | 229 SSLVerifyDepth 10 |
| 473 | 230 SSLCertificateFile /etc/certs/hostcert.crt |
| 474 | 231 #SSLCACertificateFile /etc/certs/esgf-ca-bundle.crt |
| 475 | 232 SSLCertificateKeyFile /etc/certs/hostkey.key |
| 476 | 233 #SSLCertificateChainFile /etc/certs/cachain.pem |
| 477 | 234 SSLOptions +StdEnvVars +ExportCertData |
| 478 | |
| 479 | Then you have to import your certificate and your key into your tomcat keystore (located in /esg/config/tomcat/ and named esg-truststore.ts and keystore-tomcat). They are configurated in /usr/local/tomcat/conf/server.xml. |
| 480 | |
| 481 | 1. If the self-signed certificate is installed in keystore-tomcat, remove it with `keytool -delete -alias ALIAS -keystore keystore-tomcat`, where alias can be obtained with `keytool -v -list -keystore keystore-tomcat`. |
| 482 | |
| 483 | 2. Execute `# openssl pkcs12 -export -in /etc/certs/hostcert.crt -inkey /etc/certs/hostkey.key -out server.p12 -name my-esgf-node -CAfile /etc/certs/hostcert.crt -caname root` and `keytool -importkeystore -deststorepass PASSWORD -destkeypass PASSWORD -destkeystore keystore-tomcat -srckeystore server.p12 -srcstoretype PKCS12 -srcstorepass PASSWORD -alias my-esgf-node` |
| 484 | |
| 485 | 3. Restart the node: `esg-node restart` |
| 486 | |