I am using the Lets Encrypt for cPanel plugin to use a signed certificate for my https website. Before I started using this, my created websocket server did worked like a charm. However, after using HTTPS I was forced to use secured sockets (WSS) to connect with my websocket server which is written in PHP.
In order to make use of WSS I have to install a PEM file. Since cPanel does not provide me a PEM file I'm a little bit confused. How do I generate such PEM file?
I've got an example of how the PEM file should look like. So I copied the code of the certificate generated by Lets Encrypt into a empty file with a PEM extension but now I need a RSA private key. Should I use the one of SSH access or should I generate a new RSA key?
Also, I can create a websocket server succesfully with the self generated PEM file, but however, I can't connect to this server with the browser because the buffer can't be read (returns 0 bytes).
Would be nice if someone could tell me how to generate a proper PEM file so I can install that for the secured websocket connection. My PHP websocket server is exactly the same as the linked repository of the PEM file example.
After some nights of good sleep I found the solution myself, its not that hard actually.
Lets Encrypt creates a folder inside "public_html" called "ssl". Inside that folder you can find the *.crt and *.key files. Copy the content of it into a new *.pem file and upload this pem file to the server. Now you can use secured websockets.