title: Using Comodo SSL with AWS Certificate Chain
body: <p>This is basically a follow up to <a href="https://stackoverflow.com/questions/13044451/how-to-generate-the-certificate-chain-for-aws-load-balancer">this question</a>. After buying a Comodo SSL Certificate, I was also only sent two files in a zip folder - fake_domain.crt and fake_domain.ca-bundle. Most references I have seen say that I should have received 4 files, such as COMODORSADomainValidationSecureServerCA.crt.</p>
  
  <p>To upload my SSL cert onto the AWS load balancer, it requires the Private Key, Public Key Certificate and Certificate Chain, all in PEM format. The private key and cert are simple enough. For the chain, using the answer from the referred question -</p>
  
  <pre><code>cat certfile.crt bundle.ca-bundle &gt;&gt; chain.crt
  </code></pre>
  
  <p>did not work. AWS responded with the following error:</p>
  
  <p>Error creating certificate
  Unable to validate certificate chain. The certificate chain must start with the immediate signing certificate, followed by any intermediaries in order. The index within the chain of the invalid certificate is: 1</p>
  
  <p>Converting both of the files to PEM format and THEN concatenating also failed. This was the command I used and then copied the output into AWS Certificate Chain field:</p>
  
  <pre><code>openssl x509 -inform PEM -in fake_domain.crt; openssl x509 -inform PEM -in fake_domain.ca-bundle
  </code></pre>
  
  <p>How do I create the Certificate Chain correctly for AWS load balancers?</p>