Sitecore 9 – set up SOLR SSL step by step

I’ve noticed that many people have many issues with set up of SSL for SOLR instance. In this blog post you will find everything what you need to know to do this. Just follow all steps which you will find below.

  1. Download SOLR 6.2.2
    If you want to install SOLR on Windows get zip file from following page: http://ftp.ps.pl/pub/apache/lucene/solr/6.6.2/
    then extract files into (you can choose different directory if you want).

    C:\solr\solr-6.6.2
  2. Download Not Sucking Service Manager and install Solr as a service
    You will find zip here: https://nssm.cc/download – just extract it somewhere and go to this path in your PowerShell window. Then call

    .\nssm.exe install NameOfSolrService

    and you will see new window with some settings. Set there following values:

    - Path: C:\solr\solr-6.6.2\bin\solr.cmd
    
    - Startup Directory: C:\solr\solr-6.6.2\bin
    
    - Arguments: start -p 662 -f -v

    After form submission you should see new service on the list of services (Windows > Run > Services) . If your service is not running – just run it from services windows – it will start automatically after restart.
    We have chosen port 662 so our SOLR instance currently will be available under url http://localhost:662/solr/

  3. Generate SOLR Certificates
    We use approach from this website https://lucene.apache.org/solr/guide/6_6/enabling-ssl.html#EnablingSSL-BasicSSLSetup
    At the beginning you should check if you have JRE installed – if not install it and then in the path

    C:\Program Files (x86)\Java\jre1.8.0_141\bin\keytool.exe

    you will find keytool.exe which will generate certificates for you (you might have different path – depends on version of JRE).
    Then open again PowerShell and enter into SOLR directory

    C:\solr\solr-6.6.2\server\etc

    and run following command

    & 'C:\Program Files (x86)\Java\jre1.8.0_141\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"

    You should notice that we have got there keypass equal to “secret” which can be changed on local, and should be changed on other environments.
    Then we need to convert key to PEM format with command:

    & 'C:\Program Files (x86)\Java\jre1.8.0_141\bin\keytool.exe' -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12

    You will be asked few times for password – use “secret” or your own.
    Then we need to convert generated key for next format with OpenSSL – download OpenSSL from here https://indy.fulgan.com/SSL/openssl-0.9.8r-x64_86-win64-rev2.zip and extract into

    C:\Program Files (x86)\OpenSSL

    and run command:

    & 'C:\Program Files (x86)\OpenSSL\openssl.exe' pkcs12 -in solr-ssl.keystore.p12 -out solr-ssl.pem
  4. Import certificate to the trusted certificates
    Opem “Windows > Run > mmc” and manage certificates. Import created certificate to the list of trusted ones.
  5. Change SOLR settings
    In final step you need to change yours configuration for SOLR. Open SOLR server directory

    C:\solr\solr-6.6.2\bin

    and open to edit of solr.in.cmd file. Then add at the end following settings:

    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
    
    REM Require clients to authenticate
    
    set SOLR_SSL_NEED_CLIENT_AUTH=false
    
    REM Enable clients to authenticate (but not require)
    
    set SOLR_SSL_WANT_CLIENT_AUTH=false
  6. Test
    To test if it works you need to restart yours SOLR service. After restart SOLR will not longer work with http protocol – so you need to go into “https://localhost:662/solr” to check how your SSL works.

And now you are ready to install Sitecore 9 and xConnect. Have a good fun with it!

Presentation about SPEAK – 15 September 2017 Bialystok

On 15 September in Bialystok I had a pleasure to talk about SPEAK 2.

During presentation I showed how to start working with Sitecore and how to prepare own custom components.

It was great to share that knowledge and answer to many questions about basic and more advanced stuff.

Few photos from the event:

 

Career Fairs – June 2017 – Białystok – KarieraIT

At the beginning of June I had a pleasure to present some information about Sitecore for people who were interested in new possible career paths on the job market.

I want to share with you my presentation and few photographs.

Photos owner is KarieraIT

If You were there and You were listening my presentation – please share with me your thoughts. I would really appreciate that.

Could not load file or assembly ChilkatDotNet – Email Experience Manager

From time to time, especially when you are setting up new Sitecore environment on local machine or server you probably have some dependencies issues.

My favorite one is error with dependency of ChilkatDotNet. Why it is my favorite? Because even when you have all Sitecore files on place and installed all modern versions of .Net Framework this library still can brake Sitecore application (You can find ChilkatDotNet library inside Sitecore Email Experience Manager).

In the internet you will find some solutions related to Sitecore environments:

  • http://labs.steveottenad.com/sitecore-damn-you-chilkat/
  • http://www.letsdositecore.com/chilkatdotnet2-dll-in-sitecore-6-5/

But the problem is – they are all about x32 vs x64 bit architecture and used version of chilkatdotnet library – they were not helpful for me.

Enable assembly bind failure logging

I had started to find a way to extend logs to know more about the problem and I found some articles about additional logging mechanisms for assemblies. I decided to enable that in my registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
Add:
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
DWORD EnableLog set value to 1
String LogPath set value to folder for logs (e.g. C:\FusionLog\)

Unfortunately it did not help for me – I did not find there anything significant (but in general I think that it is worth to know that settings).

You will find more about this here: https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net

Old tool for modern work

After checking everything again I had started search of new solutions for my issue and I found one – Dependency Walker.

On website http://www.dependencywalker.com/ you will find simple tool which can check details about dll dependencies and display all errors/warnings.

It might looks like this:

As a result of “opening dll” you will see all broken dependencies. You just have to take the name of missing dll file and check from which library it is to add it to the system or directory.

In my case it was missing “Microsoft Visual C++ 2012 Redistributable” – yes, quite old version – I would not ever install this without Dependency Walker.

Hopefully this tool will also save your time as it saved my – enjoy!

 

Sitecore Data Exchange Framework – diagram

Few weeks ago I had an opportunity to take a look into Sitecore Data Exchange Framework. At first glance it was looking very cool and still it is but I have realized that one thing there is missing. In this post I will provide you something what will help you understand how it works.

If you do not know for what we can do with Sitecore Data Exchange Framework, following definition from documentation should tell you everything:

Data Exchange Framework is designed to facilitate the transfer of data between two systems.

You can find more on documentation page: http://integrationsdn.sitecore.net/DataExchangeFramework/v1.3/getting-started/overview.html

In documentation you will find very well described parts of the framework but it can be hard to “connect the dots” right away. That is why I have prepared diagrams – because image is worth a thousands words.

You can use them after/during reading of official documentation.

Standalone pipeline

Pipelines in batch

Summary

Diagrams describe how all elements of framework are connected and how they cooperate. If something on the diagrams is not readable then try to open pdf file from here: Sitecore Data Exchange Framework – Diagrams