Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 11 down vote accepted

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:

share|improve this answer
Both links of and are broken. I have edited your answer to reflect the new information as current, if you dont mind. – Faron Jul 8 '15 at 22:02
Link to the apple website is broken. It redirects to the Safari browser home page. – Aerendir Apr 28 at 15:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.