title: Firebase truststore and setting up Spring to accept certificates from Firebase
body: <p>I have a Angular PWA hosted in Firebase, and I have a Spring boot service I'm trying to communicate with (running locally at the moment).</p>
  
  <p>Firebase out of the goodness of their heart automatically create a SSL certificate for the hosted app, so that is secure and only accessible via HTTPS. </p>
  
  <p>What I can't work out is how to setup my Spring boot service to accept/trust/allow those connections so the PWA can make basic REST calls for example (Do I even need to do this?). </p>
  
  <p>My first thought was to add the certificate from Firebase to the Spring boot truststore, but either I'm doing it wrong or that is the wrong approach as I'm just getting <code>javax.net.ssl.SSLHandshakeException: no cipher suites in common</code> with everything I've tried.</p>
  
  <p>The commands I've ran to do this are as follows: </p>
  
  <p>Download the certificate from Angular app URL</p>
  
  <pre><code>keytool -printcert -sslserver app.example.com:443 -rfc &gt; temp.cert
  </code></pre>
  
  <p>Create a truststore from that certificate</p>
  
  <pre><code>keytool -keystore truststore.jks -alias example.com -import -file temp.cert
  </code></pre>
  
  <p>Then I'm just loading that into my Spring boot <code>application.yml</code> file</p>
  
  <pre><code>server:
    port: 8443
    ssl:
      key-store: classpath:truststore.jks
      key-password: secret
      key-alias: example.com
  </code></pre>
  
  <p>I'm not really sure if I've done this completely wrong, or missed a vital step. </p>