Using Letsencrypt certificate

Need help? Post your questions here.

Moderator: moderators

Using Letsencrypt certificate

Postby jarome » Wed Jul 17, 2019 1:29 pm

I followed the instructions at https://gist.github.com/alvarow/b691da8768a590b623261c845782f081 to install my letsencrypt certificate. But even after restarting my Subsonic server (OpenSUSE LEAP 15.1), it is still using the self-signed Subsonic certificate. How do I fix this?
jarome
 
Posts: 88
Joined: Sat Apr 16, 2011 2:53 am

Re: Using Letsencrypt certificate

Postby MrChimp1 » Sat Aug 10, 2019 8:51 am

Did you manage to fix this? I use LetsEncrypt and I can send you my instructions for setting this up.
MrChimp1
 
Posts: 4
Joined: Fri Aug 09, 2019 7:21 pm

Re: Using Letsencrypt certificate

Postby MrChimp1 » Sat Aug 10, 2019 9:52 am

OK, managed to get near my computer for 5 minutes. I can't take full credit for all this, its a collection of research but it works for me everytime on a raspberry pi.

1) Create CSR:
openssl req -new -newkey rsa:2048 -nodes -keyout subsonic.domainName.key -out subsonic.domainName.csr

2) Complete cert request via LetsEncrypt and save new cert as "YourNewcert.cer"
!!!! Where prompted use password "subsonic"

3) Obtain the LetsEncrypt root and intermediate certs then combine files:
cat subsonic.domainname.key YouNewCert.cer LetsEncryptIntCert.cer LetsEncryptRootCert.cer > subsonicCertBundle.crt
e.g. cat hostname.key hostname.crt PositiveSSLCA2.crt AddTrustExternalCARoot.crt > subsonic.crt

4) Convert to PKCS12
openssl pkcs12 -in subsonicCertBundle.crt -export -out subsonic.pkcs12

5) Import into keystore:
sudo keytool -importkeystore -srckeystore subsonic.pkcs12 -destkeystore subsonic.keystore -srcstoretype PKCS12 -srcstorepass subsonic -srcalias 1 -destalias subsonic
{password 'subsonic'}

6) Place the keystore into Subsonic:
sudo zip /usr/share/subsonic/subsonic-booter-jar-with-dependencies.jar subsonic.keystore

7) Enable SSL in subsonic:
sudo nano /etc/default/subsonic
SUBSONIC_ARGS="--port=0 --https-port=443 --max-memory=200"

Note when changing port, only root can bind to ports below 1024 by default, so if you run Subsonic under a service account, see my other post here
MrChimp1
 
Posts: 4
Joined: Fri Aug 09, 2019 7:21 pm

Re: Using Letsencrypt certificate

Postby jarome » Sat Aug 10, 2019 12:42 pm

Rebooting the computer changed the subsonic certificate I believe.
jarome
 
Posts: 88
Joined: Sat Apr 16, 2011 2:53 am

Re: Using Letsencrypt certificate

Postby tangert » Mon Dec 02, 2019 8:31 pm

With ubuntu 19.10 I needed to add "-deststoretype PKCS12" to the keytool command to make this work:

sudo keytool -importkeystore -srckeystore subsonic.pkcs12 -destkeystore subsonic.keystore -deststoretype PKCS12 -srcstoretype PKCS12 -srcstorepass subsonic -srcalias 1 -destalias subsonic
tangert
 
Posts: 2
Joined: Sun Aug 04, 2013 3:29 pm

Re: Using Letsencrypt certificate

Postby d0tm4tr1x » Sat Jan 18, 2020 8:55 pm

Some small adjustments:

With the filesnames you get from LetsEncrypt
3) Obtain the LetsEncrypt root and intermediate certs then combine files:
Code: Select all
cat privkey.pem > subsonic.crt
cat cert.pem >> subsonic.crt
cat chain.pem >> subsonic.crt


I'm running 6.1.6 and the file is in a different place (I use both locations)
6) Place the keystore into Subsonic:
Code: Select all
sudo zip /var/subsonic/subsonic-booter-jar-with-dependencies.jar subsonic.keystore
Subsonic Premium
6.1.6 (build 0cfa60)
Ubuntu 20.04.4 LTS
User avatar
d0tm4tr1x
 
Posts: 9
Joined: Thu Dec 28, 2017 11:31 am


Return to Help

Who is online

Users browsing this forum: No registered users and 8 guests