Skip to main content

Setting/Enabling Solr as SSL for Sitecore 9.2/Sitecore 9.3


Solr can encrypt communications to and from clients, and between nodes in SolrCloud mode, with SSL.
Sitecore has changed their security model and hence Sitecore required SSL enabled Solr for their 9.0 onwards version.
Pre-Requisite:
    1. Install JRE :
           Make sure you have installed the JRE, if it not there then download from link:                         http://www.oracle.com/technetwork/java/javase/downloads/index.html 
    2. Download Solr :
           Download Solr version from below link. I used 7.5.0
          https://indy.fulgan.com/SSL/   
    3. OpenSSL
          Download OpenSSL from location
Note: Extract zip file of SSL and copy bin folder of JRE.
            4.  Setup Solr as Windows service
           Follow below link to install Solr as Windows Service:

Follow below link to setup SSL without PowerShell script

         1. Generate a Self-Signed Certificate and a Key
To generate a self-signed certificate and a single key that will be used to authenticate both the server and the client, we’ll use the JDK keytool command and create a separate keystore. This keystore will also be used as a truststore below. It’s possible to use the keystore that comes with the JDK for these purposes, and to use a separate truststore, but those options aren’t covered here.
A)      Run the commands below in the server/etc/ directory in the binary Solr distribution.


“C:\Program Files\Java\jre1.8.0_221\bin\keytool.exe” -genkeypair -alias solr-ssl -keyalg RSA -keysize 2048 -keypass secret -storepass secret -validity 9999 -keystore solr-ssl.keystore.jks -ext SAN=DNS:localhost,IP:127.0.0.1 -dname “CN=localhost, OU=Organizational Unit, O=Organization, L=Location, ST=State, C=Country”

    Note : The above command will create a keystore file named solr-ssl.keystore.jks in the current directory.
B)     It will prompt and ask to enter password : secret ( You can enter any password and remember it)


         2. Convert the Certificate and Key to PEM Format
          First convert the JKS keystore into PKCS12 format using keytool
    “C:\Program Files\Java\jre1.8.0_221\bin\keytool.exe”-importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12

Note : The keytool application will prompt you to create a destination keystore password and for the source keystore password, which was set when creating the keystore ("secret" in the example shown above)
    3. Next convert the PKCS12 format keystore, including both the certificate and the key, into PEM format using 
“C:\Program Files\Java\jre1.8.0_221\bin\openssl.exe" pkcs12 -in solr-ssl.keystore.p12 -out solr-ssl.pem

        4. Set Common SSL-Related System Properties
      Open file bin\solr.in.cmd from bin folder of Solr and modify as below.
set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
set SOLR_SSL_KEY_STORE_PASSWORD=secret
set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
set SOLR_SSL_TRUST_STORE_PASSWORD=secret
set SOLR_SSL_NEED_CLIENT_AUTH=false
set SOLR_SSL_WANT_CLIENT_AUTH=false
  5.  Verify Server/etc folder and validate below 3 files 
    6.   Install the certificate                                                                                                             
       Double click on the generated solr-ssl.keystore.p12 file and follow the wizard to import the certificate. When you reach the Certificate Store window, make sure to place the certificate in the Trusted Root Certification Authorities.  


 7.  Post import the certificate, reset Sole service and browse the Solr URL using https.

Visit for more Info:

Comments

Popular posts from this blog

Sitecore Publishing target and Solr Configuration

Creating a new publishing target is very helpful if your Sitecore environment is setup in multiple content delivery servers. We can publish data from Master database to one or more publishing target databases. Main thing to notice here is Master database contains all versions of any content or assets while publishing target database contains single latest version for each language.      This post aims to provide systematic instructions to set up publishing target. It comprises of a target database (where the content will be published) and publishing target definition item in master database that points to that target database.             Post creation of publishing target need to take care of Solr configuration. This post cove master slave Solr configuration and onPublishEndAsync strategy. We are using 1 Solr Master instance and 6 Slave instance (2-EU, 2-Ap, 2- NA).     1   So...

Setup Sitecore Habitat v9.0 project in simple way

In this article , I would describe how to setup the Sitecore habitat V9.0 project with Sitecore Experience Platform 9.0 rev in very simple way. I used below system configuration to setup this project: 1. Windows 10 (32/64-bit) 2. IIS 10.0 3. .NET Framework 4.6.2 4. Microsoft Visual Studio 2017 5. Microsoft SQL Server 2017 6. Solr 6.6.2 7. Microsoft PowerShell® version 5.0 8. Web Platform Installer 5.0. 9. Web Deploy 3.6 for Hosting Servers 10. Node-v8.9.4-x64 Follow below steps to setup the project. A).   Habitat require Sitecore instance. Setup the clean Sitecore 9.0 instance. Ex : http://demo.local.com , Directory location : C:\inetpub\wwwroot\demo.local.com   For more info visit -   https://dev.sitecore.net/ B). Download the Habitat V9.0 project from Github site :  https://github.com/Sitecore/Habitat/     Note  :  When you download the packages, it is possible that the .ZIP packages are marked as blocke...

Web Deploy setup and configuration with Sitecore

Web Deploy empowers Visual Studio and WebMatrix to help developers streamline the deployment of Web applications to Microsoft IIS Web servers or to Microsoft Azure Websites. In addition, integration with Web Platform Installer allows developers to simply and easily install community webapplications.   This post describe the installation of Web Deploy and Configuration with Sitecore instance.  This post will be very useful if you want to sync your Sitecore media items with all of the CD's environment (Distributed environment) . In one of my previous project, I was keeping all the media items in file system and synchronizing all the files from CM to Cd's server. This solution is tested with 1 CMS and 6 CD's server (2-EU, 2- NA, 2- AP) with more than 5 Lakh files.  1.       Software Pre-requisites           a.       OS – Window 7/ Windows Server 2008 R2 Enterprise       ...