I recently installed the developer preview of Mac OS X 10.7 Lion and have been quite pleased with the update. However, apart from the AFP issue, which was quickly fixed, and the Time Machine issue, which remains unsolved, it appears that Safari 5.1 does not like self-signed certificates!

Safari can’t open the page. Safari can’t open the page “https://example.org/”. The error is: “The certificate for this server is invalid. You might be connecting to a server that is pretending to be “example.org” which could put your confidential information at risk.” (NSURLErrorDomain:-1202) Please choose Safari > Report Bugs to Apple, note the error number, and describe what you did before you saw this message.

The certificate for this server is invalid. (NSURLErrorDomain:-1202)

Fortunately, there is a way to force Safari 5.1 to accept self-signed certificates. Now I know one could dump the certificate via openssl and the command line, but this method did not work for me since I am accessing my sites on an internal network and it would always dump the certificate for my default Apache virtual host. As such, the instructions below use a sort of round about method to import these certificates, but it works.

Basically these instructions show you how to use Firefox to export a self-signed SSL certificate and import it into Keychain Access. Hopefully it helps a few people out.

Read more