I use S3 to host website and I would like to use SNI support of cloudfront to use SSL, I use below command to generate certificate.
/letsencrypt-auto --manual --config cli.ini --agree-tos certonly -d test.example.com --server https://acme-v01.api.letsencrypt.org/directory --agree-dev-preview
I use below command to upload the certificate to cloudfront
aws iam upload-server-certificate
--server-certificate-name my-server-cert
--certificate-body file://cert.pem
--private-key file://privkey.pem
--certificate-chain file://chain.pem
--path /cloudfront/
When I try to set the uploaded certificate I get below error from cloudfront
com.amazonaws.services.cloudfront.model.InvalidViewerCertificateException: The specified SSL certificate doesn't exist in the IAM certificate store, isn't valid, or doesn't include a valid certificate chain. (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidViewerCertificate; Request ID:
Please let me know anyone could find whats the issue.