I recently had to go through this process and none of the answers worked for me. Here are the steps that allowed me to upload a new SSL certificate to AWS (for subsequent use in ElasticBeanstalk).
Obtaining Private Key
I had to use two commands for this process:
openssl genrsa -des3 -out server.pass.key 2048
openssl rsa -in server.pass.key -out server.key
The server.key file is your Private Key.
Additionally, you can generate the CSR (Certificate Signing Request) by doing:
openssl req -nodes -new -key server.key -out server.csr
This is the file we'll use to request GoDaddy to issue our new certificate.
Obtaining Public Key
Once the certificate has been issued in GoDaddy download it. This will give you two files which must be bundled into one by doing:
cat yourdomain.crt gd_bundle-g2-g1.crt > combined.crt
The combined.crt would be your Public Key.
Uploading server certificate to AWS
With the server.key and combined.crt file you can now upload the certificate to AWS using AWS CLI. You just have to use the following command:
aws iam upload-server-certificate --server-certificate-name your_certificate_name --certificate-body file://combined.crt --private-key file://server.key
If everything went well, you'll receive a response from the server:
{
"ServerCertificateMetadata": {
"ServerCertificateId": "ABCDEFG12345678",
"ServerCertificateName": "certificate-name",
"Expiration": "2018-08-26T11:59:38Z",
"Path": "/",
"Arn": "arn:aws:iam::1234123412:server-certificate/certificate-name",
"UploadDate": "2017-08-26T19:53:46.989Z"
}
}
And that’s it, you should have a new SSL certificate available to you in AWS.