A.K.M. Adib
A.K.M. Adib

Reputation: 567

ERR_SSL_PROTOCOL when trying to access port 3000 on AWS EC2 with Node.js

I'm following this tutorial where they are setting up a express server and when you go to the DNS you see your response (in this case HEY!), this is the link to the tutorial https://hackernoon.com/tutorial-creating-and-managing-a-node-js-server-on-aws-part-1-d67367ac5171

But when I do it gives me ERR_SSL_PROTOCOL, but the tutorial doesn't even mention anything about SSL and gets it to work.

This is my code

const express = require('express')
const app = express()
app.get('/', (req, res) => {
  res.send('HEY!')
})
app.listen(3000, () => console.log('Server running on port 3000'))

This is my security group (outbound rules is set to all traffic) enter image description here

Upvotes: 0

Views: 558

Answers (1)

httpdigest
httpdigest

Reputation: 5797

Your HTTP client/browser likely tried to establish an HTTPS/SSL connection and not an unencrypted HTTP connection to your server.

Make sure that you do not use https://... when accessing the HTTP endpoint from your client/browser, but use http://.... If you use a modern browser for this (Google Chrome for example), you likely need to go into the address bar and manually specify http:// as the URL scheme.

You can also simply test via any other HTTP client, like cURL, wget, Postman, etc.

Upvotes: 1

Related Questions