SSLException: Received fatal alert: certificate_unknow

I have a spring boot backend project.I want to use my ssl cert.

This my application.properties file.

enter image description here

I create robotikg.p12 using with mycert.cert and mycert.key.Also i added mycert.cert in cacerts with using keytool.

When application send the request backend i got this error.I didn't understand where is wrong this config.

enter image description here

Upvotes: 1

Views: 3172

Answers (1)

Renis1235
Renis1235

Reputation: 4710

When self-signing a certificate or using a self-signed CA (Certificate Authority) to sign your server's certificate, every time you perform a request through another application (be it your own or the browser), you have to tinker with your app (or browser) so that it trusts the connection that is established between itself and the server.

Browsers have their own trust stores (a.k.a key stores) where they keep the trusted certificate chains. Your certificate though, is not signed by any of these trusted certificates.

My approach would be:

  1. Create a CA (self signed)
  2. Sign a Server certificate with this CA
  3. Add the CA to your application's trust store, so that at the moment the TLS handshake is performed, the validation of the server's certificate will be performed against this trust store and thus result valid.

Upvotes: 1

Related Questions