-1

I'm setting up SSL on my website, and I can't figure out where the .pem files are, or how to get them if I don't have them. I generated the certificate and signing request with WHM, "issued" the certificate with namecheap's interface with comodo, and then installed the certificate with whm, via copy and paste. Now I'm looking to set up mysqli_ssl_set().

I originally tried to use the files located in /etc/ssl, which also contains a shortcut file to etc/pki/tls/certs. After messing around with these, I couldn't get them to work(mysqli_ssl_set() keeps coming up as a boolean). The files I was using were .key and .crt files, and w3schools page on mysqli_ssl_set() specifies .pem files. So, I looked up .pem files, and found that they are plaintext. So then I tried creating my own, via copy and paste. This also gave the same error.

So, where are the .pem files placed by WHM generally? Or, if they are not generated by WHM, how can I best resolve this issue?

UPDATE:

I believe I have the proper certificate file and key file, now I only appear to need the "certificate authority file." I'm currently trying to figure out which file this is, and how I can identify it. Any tips as to its contents would be appreciated.

SECOND UPDATE:

I think I may have other problems(or a different problem than the problem I thought I had). I'm now getting a "bad handshake" error. I'm now looking for a solution for that. It may or may not be related to my use of ssl. It may be due to my transition from mysqli_connect to mysqli_real_connect.

1 Answer 1

2

On a standard install of cPanel / WHM the SSL Cert and CABundle etc should be in /etc/ssl/certs and private keys are in /etc/ssl/private

In WHM you should be able to download any installed SSLs through Home >> SSL/TLS >> SSL Storage Manager also.

2
  • In that file I have three .pem files, one obviously containing the key, one containing the certificate, and then I assume the other one is the "certificate authority." Yet using the three of them in mysqli_ssl_set is not working. What should be contained in the certificate authority? Like whats the general template(e.g. the certificate starts with -----BEGIN CERTIFICATE----- and ends with -----END CERTIFICATE-----, making it recognizable)
    – James G.
    Oct 14, 2013 at 1:37
  • off the top of my head the CA will have -----BEGIN CERTIFICATE-----, the same as a certificate. You should be able to get a copy of the CA / chain info from the SSL provider's website. If you still have the emails from when the SSL was provided it's usually either attached to the email or there is a link to the page you can get it from. If you have the cert and the key then you've got the important bits, it's usually not to hard to get the CA
    – floodpants
    Oct 14, 2013 at 3:30

Not the answer you're looking for? Browse other questions tagged .