1、如果服务器上已经存在证书文件,把文件拷贝出来即可,这里域名以domainname.com为例
/etc/letsencrypt/live/domainname.com
cert.pem chain.pem fullchain.pem privkey.pem
这里不用fullchain.pem
2、生成“打包证书”
openssl pkcs12 -export -out archive.pfx -in cert.pem -inkey privkey.pem -certfile chain.pem -name “domainname.com”
生成证书的过程会要求设置密码(password),后续需要该密码
3、在服务器上建立适合的目录,将证书上传到服务器,并为证书设置权限
sudo chown plex:plex /var/lib/plexmediaserver/archive.pfx
4、在网页端设置Plex服务器
设置 〉 网络 〉 高级设置
Custom certificate location
/var/lib/plexmediaserver/archive.pfx
#Path to a PKCS #12 file containing a certificate and private key to enable TLS support on a custom domain.
Custom certificate encryption key
password
Custom certificate domain
domainname.com
#Domain name to be published to plex.tv using your mapped port; must match a name from the custom certificate file.
5、重启PlexServer上的服务
6、清除浏览器缓存,再次访问即是加密访问。
参考:
https://imgur.com/a/9UKLh
https://gist.github.com/srilankanchurro/fa3fdeb5cf10ebb251aa88338b8b37db