AWS EC2 – Fix HTTPS Not Working with SSL Certificate Installed

amazon ec2amazon-web-servicesload balancing

I Have insatlled ssl on my aws but not able to load my site on https https://darkcloud.app (My site)
Certificate
load balancer
Route 53

ubuntu@ip-172-31-8-134:~$ curl -v https://www.darkcloud.app
Rebuilt URL to: https://www.darkcloud.app/
  Trying 54.153.123.21...
Connected to www.darkcloud.app (54.153.123.21) port 443 (#0)
found 148 certificates in /etc/ssl/certs/ca-certificates.crt
found 594 certificates in /etc/ssl/certs
ALPN, offering http/1.1
gnutls_handshake() failed: An unexpected TLS packet was received.
Closing connection 0
curl: (35) gnutls_handshake() failed: An unexpected TLS packet was received.

Best Answer

There seems to be multiple issues:

  1. You are accessing the site with darkcloud.app but it doesn't have a DNS entry, create a similar DNS entry as www.darkcloud.app in route53
  2. Accessing site on port 443 i.e. https gives "unknown protocol" error that shows that load balancer is not configured properly for https, see curl output below:

    $ curl -I https://www.darkcloud.app curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Accessing port 443 over http (not https) gives 200, can you check forwarding rules of ALB and see if the protocol is htttps?

$ curl -I http://www.darkcloud.app
HTTP/1.0 200 OK
Date: Thu, 09 Aug 2018 17:58:22 GMT
Server: Apache/2.4.18 (Ubuntu)
Cache-Control: no-cache, private
Connection: close
Content-Type: text/html; charset=UTF-8