This post assumes that you have created a LE certificate through the QNAP NAS interface. We will set up a process to also use that cert with PMS and update itself based on a frequency decided by you using crontab.
#!/bin/sh
## Script for converting QNAP Let's Encrypt certificate to PKCS12 format needed by Plex Media Server
## This is designed to work with QTS 4.3.3+
## The script assumes that the Let's Encrypt certificate is setup and operating on the NAS
BASEPATH=/mnt/HDA_ROOT/.config/QcloudSSLCertificate/cert
CERT_PASS=SuperSecretStuff
HOST_NAME=pms-server
/etc/init.d/plex.sh stop
/usr/bin/openssl pkcs12 -export -in ${BASEPATH}/cert -inkey ${BASEPATH}/key -out ${BASEPATH}/cert.p12 -name ${HOST_NAME} -CAfile ${BASEPATH}/chain -caname root -password pass:${CERT_PASS}
/etc/init.d/plex.sh start
Thanks for posting this. One question though, you screenshots from the Plex config reflect different paths than the one you posted in the script. Does it matter which one to use? It seems redundant
Edit: If you’d be using
BASEPATH=$(getcfg “QcloudSSLCertificate” Install_Path -f /etc/config/qpkg.conf)/cert
it would dynamically adjust to the install location of the QcloudSSLCertificate qpkg
Thanks for the comments. Your command produces a path which isn’t consistent on my NAS with the cert’s actual location. I am on QTS 4.3.3 and 2.0.21 for QTS SSL Certificate. This runs on a 453-Pro.
Thank you for this. I also noticed in your example certificate domain that you used a unique top-level domain for plex on your qnap server. I am interested to learn how you managed to do that on the qnap web server interface?
If we use Plex only via the Plex app or through Plex.TV and have Plex setup to only use secured connections, is setting up cert/key in PMS pointless? This is only for ones that access their Plex directly via their custom domain?
You have to add your cert to PMS so it knows to be aware of it.
Without doing so, PMS will assume it’s a MITM redirect/hijack of the SSL/TLS and not allow it.
Settings – Server – Network – Add the Certificate info there.
You must be careful in that your certficate does not take priority over Plex’s.
If this happens, Plex (PMS) will not be able to communicate with Plex.tv