HTTPS: Make the Application Speak HTTPS
We'll cover the following...
We'll cover the following...
Objective
- Migrate our endpoint from HTTP to HTTPS.
Steps
- Make the application speak HTTPS.
- Remove the HTTP endpoint.
Making our application speak HTTPS
Let’s update our application to listen to HTTPS requests on port 8443. We’re going to make the application use the self-signed certificate that the EC2 instance generated in the UserData script when it came online.
Line #3: Import the https node library.
Line #8: We’ll use 8443 as our local HTTPS port number.
Line #9 and #10: Path to the key and certificate ...