Search code examples
amazon-web-servicesopensslamazon-elbaws-application-load-balanceraws-acm

AWS self-signed Application Load Balancer


I've created an ALB using Boto3 and want to configure that load balancer work on HTTPS (self-signed). In order to do that, I have to generate an SSL certificate with open-ssl:

openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout key.pem -out cert.pem 

Then, I've imported the certificate into AWS ACM with no problems: enter image description here

When configuring the ALB listener, I don't see the certificate in the list:

enter image description here

What could be the problem? I've imported the certificate and configured the LB in the same region.

I've regenerated the certificates with RSA 2048, still got the same result. Moreover, it does not appear to be in the list-certificates: enter image description here

---------------------- UPDATE ----------------------

Followed the above guide and it worked.

https://medium.com/@francisyzy/create-aws-elb-with-self-signed-ssl-cert-cd1c352331f

Strangely, I've succeeded in uploading the certificate into IAM using the command above:

AWS CLI:

aws iam upload-server-certificate --server-certificate-name CERT_NAME --certificate-body file://public.pem --private-key file://private.pem

Boto3:

ssl_certificate = iam_client.upload_server_certificate(
    Path = 'PATH_STRING',
    ServerCertificateName = 'CERT_NAME',
    CertificateBody = cert_body,
    PrivateKey = private_key)

Solution

  • Followed the above guide and it worked.

    https://medium.com/@francisyzy/create-aws-elb-with-self-signed-ssl-cert-cd1c352331f

    Strangely, I've succeeded in uploading the certificate into IAM using the command above:

    AWS CLI:

    aws iam upload-server-certificate --server-certificate-name CERT_NAME --certificate-body file://public.pem --private-key file://private.pem
    

    Boto3:

    ssl_certificate = iam_client.upload_server_certificate(
        Path = 'PATH_STRING',
        ServerCertificateName = 'CERT_NAME',
        CertificateBody = cert_body,
        PrivateKey = private_key)