title: PHP - Secured Websockets with cPanel and a pem file
body: <p>I am using the <a href="https://documentation.cpanel.net/display/CKB/The+Let%27s+Encrypt+Plugin" rel="nofollow noreferrer">Lets Encrypt for cPanel</a> 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.</p>
  
  <p>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?</p>
  
  <p>I've got an <a href="https://github.com/nekudo/php-websocket/blob/master/server/server.pem" rel="nofollow noreferrer">example</a> 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?</p>
  
  <p>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).</p>
  
  <p>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.</p>