Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running https not on 443 how is this possible?

If I hit my domain on any other port other than 443 I get the error below. How is it possible then to use nodejs https on different port?

Secure Connection Failed An error occurred during a connection to mysite:8080. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

For example, in the example given in the documentation they use port 8000.

// curl -k https://localhost:8000/
var https = require('https');
var fs = require('fs');

var options = {
  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};

https.createServer(options, function (req, res) {
  res.writeHead(200);
  res.end("hello world\n");
}).listen(8000);

Using CentOS 6.

like image 1000
Iglo Avatar asked Feb 03 '26 07:02

Iglo


1 Answers

record_too_long often/usually means you sent non-SSL-data to a client expecting SSL.

Try to visit your site and port via HTTP (not HTTPS). If it works, you have accidentally bound an HTTP server to it, not an HTTPS server.

like image 156
Jan Schejbal Avatar answered Feb 04 '26 19:02

Jan Schejbal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!