41

I have nginx with the following setup:

 server {
        listen       80;
        server_name  site.com www.site.com;
        root /home/site/public_html;

        listen       443;
        #server_name  site.com www.site.com;
        #root /home/site/public_html;
        ssl_certificate      /root/site.pem;
        ssl_certificate_key  /root/site.key;

However, when I view the SSL connection I am getting:

An error occurred during a connection to grewpler.com.

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)

I am using TrustWave Premium SSL as the SSL cert authority.

2 Answers 2

71

Solved. You need to add "ssl" to the end of the listen.

listen       443 ssl;
3
  • 1
    Such a simple thing and so easy to overlook. Thanks! Dec 19, 2016 at 18:43
  • I have lost 2 hours trying to find the problem. So easy to miss. Sep 10, 2018 at 5:17
  • Bravo, you have saved my day after hours of searching! Oct 11, 2018 at 13:57
4

This error I got in browser when trying to access site over SSL(https) but in fact on that port normal HTTP server was running.

You must log in to answer this question.

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