Apply Let's Encrypt certificate to Apache Solr

I am using Apache Solr v.8.11.1 with a self-signed SSL certificate,

Enabling SSL | Apache Solr Reference Guide 8.11

... on a Let's Encrypt (LE)-secured web domain. Has anyone here applied the LE certificate to Apache Solr?

There is a guide here (which I tried),

Building an Ubuntu VM in Azure running Solr, with a trusted LetsEncrypt certificate - Part 3<!-- --> - Rob Earlam<!-- -->

... but as I recall Solr complained that the certificate wasn't in the correct (PKCS12) format.

I am running into issues with the (Solr) self-signed certificate being rejected by web browsers ( net::ERR_CERT_AUTHORITY_INVALID ), preventing me from accessing Solr as a backend server on my SSL-only domain. [I configured an Apache httpd reverse proxy, but this issue appears to be the blocking step.]


Solution: apache_solr-lets_encrypt_ssl.txt · GitHub


  • Web server: Apache httpd
  • Operating system: CentOS 7
  • Environment: cloud VPS
  • Root shell access: yes
  • Using cPanel: no
  • certbot --version: certbot 1.11.0

https://solr.apache.org/guide/solr/latest/deployment-guide/enabling-ssl.html

3 Likes

Well, when I posted the link, your post was almost empty :wink:

I have no experience with Solr, but for others to help you better, you're adviced to provide as much details as possible about what's not working. Error messages, logs et cetera.

3 Likes

Does the solr user have permissions to access that path? I don't think it does, live/ is usually 0700 and owned by root.

2 Likes

That seems wrong. Why would you concatenate all 4 files from that /live/ folder ?

2 Likes

From that article:

"... So we've generated the certificates in the previous step, however Certbot creates them in PEM format which Solr doesn't like. So first up we need to convert them to PKCS12 format and we do that with the following commands:

echo "cat /etc/letsencrypt/live/XXXXX.australiaeast.cloudapp.azure.com/*.pem > fullcert.pem" | sudo sh
sudo openssl pkcs12 -export -out fullchain.pkcs12 -in fullcert.pem

Now what we're doing here is firstly concatenating the certificate chain generated by LetsEncrypt into a single PEM format certificate, we're then taking that newly concatenated certificate and using openssl to generate a new certificate in the PKCS12 format that we need."

Yeah, that does not make sense. In the /live/ folder are 4 files. One is named fullchain.pem and already is the full concatenated chain. By doing that cat you are also placing your privkey.pem and two extra, unneeded cert fragments in that file. It's possible you are now sending out your private key to every client. That's a huge no-no and if true is cause for your cert to be revoked (I don't know solr well enough to say for sure).

In short, that blog is a bad example. The below thread is better

2 Likes

What are you replying to/about?

1 Like

I haven't read it... but it can't be worse than doing:

That guide instruction is near lunacy!

2 Likes

Well, one of us has actually done the experiment. :upside_down_face:
I'd read a post before recommending it.

Then Solr is psychic!
[if it can work with that mess]

2 Likes

I think you are missing the point of SSL certificates with Solr. They are not just used to encrypt the connection, but they are also used for Authentication. Self-signed certificates work exceptionally well in these situations, and this security model is used extensively throughout open source and commercial projects.

1 Like

"I think you are missing the point of SSL certificates with Solr. They are not just used to encrypt the connection, but they are also used for Authentication. Self-signed certificates work exceptionally well in these situations, and this security model is used extensively throughout open source and commercial projects."

No, I'm not. Solr uses Basic Authentication, configured separately / independently from the SSL certificate. As I indicated at the start, the Solr self-signed certificate was blocking web browsers from accessing Solr on my domain.

Yes, you are.

The HTTP Basic support is a plugin that extends Solr, and is designed for limited intranet availability. It is actually mostly used for development and testing.

From "Securing Solr":

No Solr API, including the Admin UI, is designed to be exposed to non-trusted parties. Tune your firewall so that only trusted computers and people are allowed access.

also:

Even if these measures or others are taken, it is strongly recommended that Solr always be protected by a firewall. Solr is not designed to be exposed on the open internet.

There is no real reason or benefit to using a Public (LetsEncrypt) Certificate with Solr vs using a self-signed Certificate, as any person/service using the Solr should have access to the full self-signed certificate and be able to install it onto their local trust store.

3 Likes

As said earlier, I'm not familiar with Solr, but I'm accustomed that many of such applications are actually running behind frond-end webservers like Apache (httpd) or nginx.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.