Appendix A - OpenSSL CA Certificate for Testing¶
Warning
Disclaimer
This page is provided for :red:`testing purposes` only and the certificates are for :red:`testing purposes only`.
The following tutorial provides some guidelines for creating :red:`test` x.509 certificates:
- Do not use these certificates for production. Instead, follow your security policies.
- For information on OpenSSL, refer to the official OpenSSL docs. Although this tutorial uses OpenSSL, the material should not be taken as an authoritative reference on OpenSSL.
Procedures¶
The following procedures outlines the steps to create a :red:`test` CA PEM file. The procedure creates both the CA PEM file and an intermediate authority certificate and key files to sign server/client :red:`test` certificates.
A. Create the OpenSSL Configuration File¶
Create a configuration file
openssl-test-ca.cnf
with the following content:Optional. You can update the default Distinguished Name (DN) values.
B. Generate the Test CA PEM File¶
Create the :red:`test` CA key file
mongodb-test-ca.key
.Tip
This private key is used to generate valid certificates for the CA. Although this private key, like all files in this appendix, is intended for :red:`testing` purposes only, you should engage in good security practices and secure this key file.
Create the CA certificate
mongod-test-ca.crt
using the generated key file. When asked for Distinguished Name values, enter the appropriate values for your :red:`test` CA certificate.Create the private key for the intermediate certificate.
Tip
This private key is used to generate valid certificates for the intermediate authority. Although this private key, like all files in this appendix, is intended for :red:`testing` purposes only, you should engage in good security practices and secure this key file.
Create the certificate signing request for the intermediate certificate. When asked for Distinguished Name values, enter the appropriate values for your :red:`test` Intermediate Authority certificate.
Create the intermediate certificate
mongodb-test-ia.crt
.Create the :red:`test` CA PEM file from the :red:`test` CA certificate
mongod-test-ca.crt
and :red:`test` intermediate certificatemongodb-test-ia.crt
.
You can use the :red:`test` PEM file when configuring mongod
,
mongos
, or mongosh
for TLS/SSL :red:`testing`.
You can use the :red:`test` intermediate authority to sign the :red:`test` certificates for both the server(s) and client(s). A single authority must issue the certificates for both the client and the server.