Enabling SSL – Solr security
In this example, we will see a basic SSL setup using a self-signed certificate. Enabling SSL ensures that communication between the client and Solr server is encrypted.
Prerequisites
Before generating a self-signed certificate, ensure that you have OpenSSL installed on your machine. To check whether OpenSSL is already installed, type the following command in the Command Prompt:
openssl version
It should print out the current version of OpenSSL running on your system. If it does not do so, kindly download the latest version of OpenSSL for your operating system and then install it.
We will also make use of JDK's keytool for generating self-signed certificates.
Generating a key and self-signed certificate
JDK provides the keytool
command to create self-signed certificates. What we will first do is create a keystore using the following command:
keytool -genkeypair -alias mysolr -keyalg RSA -keysize 2048 -keypass solrpass -storepass solrpass -validity 3650 -keystore mysolrkeystore...