title: How to export my domain cert from AWS Certificate Manager for import into Java keystore?
body: <p>I purchased the domain name 'jimtough.org' directly from Amazon so I could use it with a Cloudfront distribution. Now I have a very simple vanity site at <a href="https://jimtough.org/" rel="nofollow noreferrer">https://jimtough.org/</a> that uses the certificate. I also played around with AWS API Gateway and confirmed that I can use the same certificate to provide HTTPS secured URLs to work with API Gateway.</p>
  <p>I am also running a Java/Spring Boot web application on an EC2 server. I have already associated a Route53 DNS name with the EC2 server that hosts my Spring Boot application, like this: <a href="http://instance-b.jimtough.org/" rel="nofollow noreferrer">http://instance-b.jimtough.org/</a>. This works, but it is using unsecured HTTP. I get a bunch of warnings when I try to do basic authentication in the application, since it would be sending my username/password via an insecure connection. Fair enough.</p>
  <p>So my next step is to enable HTTPS in Spring Security and force secure connections to the application. In order to do this, I first need to provide a certificate for the Java runtime on the EC2 host to use. I found examples of how to do so <strong>with a self-signed certificate</strong>:</p>
  <ul>
  <li><a href="https://mkyong.com/spring-boot/spring-boot-ssl-https-examples/" rel="nofollow noreferrer">https://mkyong.com/spring-boot/spring-boot-ssl-https-examples/</a></li>
  <li><a href="https://www.baeldung.com/spring-boot-https-self-signed-certificate" rel="nofollow noreferrer">https://www.baeldung.com/spring-boot-https-self-signed-certificate</a></li>
  </ul>
  <p>Unfortunately, using a self-signed certificate is not what I'm looking for. I want the user to be able to browse my static content vanity site first (<a href="https://jimtough.org/" rel="nofollow noreferrer">https://jimtough.org/</a>), and then follow a link to my web app and keep using the same site certificate (my AWS-issued cert) for my Spring web app.</p>
  <p><strong>QUESTION: How can I use my AWS-issued certificate with my Java-based web application?</strong></p>
  <p>Inside the AWS Certificate Manager (<a href="https://console.aws.amazon.com/acm/home?region=us-east-1#/" rel="nofollow noreferrer">https://console.aws.amazon.com/acm/home?region=us-east-1#/</a>), I don't see any way to 'export' or save my certificate. Am I missing something? Maybe Amazon doesn't want me to use this certificate outside of their own services?</p>
  <p>Note that I did originally set up the certificate with the domain name as 'jimtough.org' and the Additional Names field set to '*.jimtough.org' so I can use the certificate on sub-domains as I'm trying to do here.</p>
  <hr />
  <p><strong>EDIT</strong></p>
  <p>The accepted answer from <a href="https://stackoverflow.com/users/4346453/julien-b">julien-b</a> is correct. I did some more research and found that SSL certificates aren't cheap, and come in different flavors. The cheapest is the 'DV' (Domain Validation) type, which only verifies that the SSL certificate is controlled by someone who also controls the DNS record for the associated domain (such as 'mydomain.com'). There are much more thorough (and expensive) certificate types that can be issued, where the issuer has to do background checks on the owning organization. Those are meant for sites that handle e-commerce, financial transactions, etc. Not at all what I need.</p>
  <p>There are also multiple types of multi-site certificates to choose from. The very cheapest single-domain certificates only cover your primary domain and the 'www' subdomain (mysite.com and <a href="http://www.mysite.com" rel="nofollow noreferrer">www.mysite.com</a>). If you want all the subdomains of your primary domain covered (app.mysite.com, ftp.mysite.com, etc), then you'll need a 'wildcard' certificate. Those are significantly more expensive. The more exotic certificate types can cover multiple different domains. These seem to be aimed at making certificate management easier for organizations that manage a lot of different domains and don't need a different certificate for each. Not what I need, so I didn't investigate further.</p>
  <p><strong>I decided to go with a 'single-domain with subdomain wildcard' certificate from Comodo (recently renamed to Sectigo?), who appears to be the most affordable certificate vendor right now.</strong></p>
  <p>REFERENCE: <a href="https://www.techradar.com/news/best-ssl-certificate-provider" rel="nofollow noreferrer">https://www.techradar.com/news/best-ssl-certificate-provider</a></p>
  <p>It seems like a missed opportunity for Amazon that they don't get in on this game and issue their own SSL certificates for a fee. AWS already has all the infrastructure in place to do so, at least for the DV-level certificates.</p>
  <hr />