12

I am developing a web application on localhost with domains and sub-domains and I would like to use a HTTPS connection. On my Mac OS, in order to enable SSL, I need to set Apache correctly, so I followed some guide to accomplish part of that.

Now it is time to choose a certificate in order to test HTTPS requests. I seen the cacert.pem, but I don't know how to use that and for what it is used (can you explain to me some about its usage?)...

So, is it possible to use the cacert.pem (see the link) for all my domains and subdomains (maybe, as a wildcard certificate) on localhost?

  • If so, how to do that? What certificate I have to take and use?

  • If no, what I need to do in order to use a wildcard certificate for all my domains and subdomains on localhost?

Of course those certificates must be accepted by browsers and working for HTTPS connection between my domains.

user65567
  • 651
  • 2
  • 6
  • 9

1 Answers1

15

cacert.pem is a collection of trusted root certification authorities. You can't use these to secure your own site. There are a number of reasons, but mainly: you don't have the matching private key.

You site certificate contains a public key that is used by the client to encrypt messages to your server that can only be decrypted by the matching private key.

Your question suggests a lack of understanding of public key cyptography. Granted, you can get a lot done without it, but it helps to read up on the basics:

To correctly generate the keys and certificates you need, this guide is useful, and specific to Apple/Apache/mod_ssl: http://developer.apple.com/internet/serverside/modssl.html

SmallClanger
  • 8,947
  • 1
  • 31
  • 45
  • 1
    Both links of carillon.ca and apple.com are broken. I have edited your answer to reflect the new information as current, if you dont mind. – Faron Jul 08 '15 at 22:02
  • Link to the apple website is broken. It redirects to the Safari browser home page. – Aerendir Apr 28 '16 at 15:50