In this recipe, we will look at how to use X.509 certificates to encrypt traffic sent to MongoDB servers. Although TLS is the actual term used to denote Transport Layer Security (TLS), for legacy naming reasons, it is many a times still referred to as SSL.
Setting up and configuring TLS (SSL)
Getting ready
You need the standard MongoDB binaries.
How to do it...
- We will begin by creating our own Certificate Authority (CA) to generate self-signed certificates:
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
- Create...