1

As a developer, I will be running and testing the web apps that I am developing locally. But Chrome and Safari are not allowing me to hit my local server with SSL enabled.

https://localhost:8443/ is not working saying SSL error with the following error message. I think, it is something to do with adding my certificate to OS X Keychain Access, but I couldn't figure what actually needs to be done!

Could some one please help me out!

SSL connection error Hide details Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have. Error code: ERR_SSL_PROTOCOL_ERROR

Update

I was generating the self signed SSL keystore and certificate using the below command

keytool -genkey -alias tomcat -keyalg RSA -sigalg SHA256withRSA -keystore /path/to/keystore -keysize 2048 -validity 365

My problem got resolved, when I generated my self signed certificate with below simple command.

keytool -genkey -alias tomcat -keyalg RSA -keystore /path/to/keystore

I am not sure why!?

1
  • 2
    I have the same issue when localhost testing using BrowserStack. I have to confirm a security exception (I don't own the domain for localhost) in Chrome, IE, Edge, and Firefox. But Safari just stops before loading the page. No error. Just stops. I have a self-signed certificate that all the other browsers give me a warning about. I don't care, I'm testing on my localhost. But Safari won't go there, won't give a message. I can't test on Safari without installing to a real server with a real cert! Sep 20, 2017 at 14:48

5 Answers 5

1

It's likely that the issue is with certificates for your server. You probably don't have a SSL certificate for localhost:8443 (as it's unlikely that any CA is going to issue one for that hostname), so of course you're going to get certificate errors. Either click through the certificate errors; or choose a valid domain that you control, get a certificate for it, and host your site on that domain.

If you have a certificate for your domain (example.com) and you have a SSL certificate for that domain (e.g., for www.example.com), another thing you could try is setting up DNS (or your /etc/hosts file) so that www.example.com resolves localhost (127.0.0.1). This still might run into other issues, and really, it's better to just test it on the domain you have a certificate for or click through the certificate errors.

None of this is likely to be Mac OS X specific.

1
  • Thank you for the answer DW. We did get a certificate for our original domain name. But I can't use that domain name, when I am developing it in my local. I can only call it with localhost or else my system name. Both are not valid domain names. There should be a way to use while we are in the development mode right ? Jan 19, 2015 at 4:24
1

Two things I would do:

  1. If the service is listening on *:8443, then I would not call https://localhost:8443 but more https://MyMachineName:8443, because that enables me to

  2. Use the company certificate and put a DNS alias in your /etc/hosts file, like

    192.168.24.3 www.mycompany.com

But it HAS TO BE the same name as in the certificate, the CN!

Beware: Every time you enter now "www.mycompany.com:8443" or "www.mycompany.com" Safari/Chrome would now redirect you to your local instance. :) Don't be irritated and don't call your Helpdesk when your company site is not reachable due to your local webserver being stopped. :)

Happy developping! :)

0

If your local web server is still using SSLv3 then current versions of Chrome will no longer connect to it. Chrome (and I believe Safari) have removed support for SSL3 fallback to mitigate the POODLE vulnerability.

If you believe that your server may be still using SSL3 the do a quick Google of "POODLE SSLv3" to get more information.

1
  • We are using TLS protocol for SSL. As my problem started some time in December 2014, when I took the latest chrome update ( which was when google disabled support for SSL 3.0 in their chrome update 39 ), Seems like you are right, but I see sslProtocol="TLS" in my server.xml of tomcat server. Where else I can get to know, what SSL version that I am using ? Jan 17, 2015 at 8:36
0

For local testing you can use a Self-Signed certificate. Generate your own using openssl utility or you can use this site selfsignedcertificate.com

You may add the generated certificate as trusted certificate under your browser settings.

0

Use your local network IP address. You can find it by running ifconfig from a bash terminal. It produces some output like:

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.16.0.123  netmask 255.255.255.0
...
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
...

In the above, your IP address is 192.16.0.123.

Now in the address bar of Safari, instead of:

https://localhost:8443

Use

https://198.162.0.123:8443

Worked for me on Browserstack. Thanks to Aravind Paul in BrowserStack Support for this answer!

2
  • 1
    If this is a quote from someone else it would be nice to also provide a direct link to the source. Sep 20, 2017 at 15:58
  • Can't. It was sent to me in an email. The direct quote would be, "could you replace 'localhost' with your machine's local IP address(not the loopback address) and test on macOS Sierra? For example, if your machine's local IP is 10.10.10.10, a sample URL can be passed as : 10.10.10.10:8443" Sep 20, 2017 at 18:51

You must log in to answer this question.

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