Skip to content
Advertisement

How can i solve [Received fatal alert: bad_certificate]?

I’ve created two servers locally, and I’m going to apply a mutual authentication to their communication. I just don’t know what the problem is. I lack understanding of this mechanism, but I also lack understanding of the server itself.

  • Create each key store
JavaScript
JavaScript
  • Export to X.509 to register certificate in Truststore.
JavaScript
JavaScript
  • Register each other’s certificates in Truststore.
JavaScript
JavaScript
  • server’s application.properties
JavaScript
  • client’s application.properties
JavaScript
  • The application main function of the client was set as follows. server as well
JavaScript
  • This is the part where the client calls the server’s API to RestTemplate.
JavaScript
  • I got a exception from client
JavaScript
  • and this is server’s exception
JavaScript

I was able to see answer below and fix this problem.By the way I wrote as follows.I hope to be helpful to people who are experiencing the same problem

JavaScript

Advertisement

Answer

I think creating RestTemplate with new keyword will not send the certificate to the server. Instead, you should wrap the SSL certificate in the Rest template. Please try this:

JavaScript
Advertisement