Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java trust unix certificate store

I have added a crt to /etc/pki/ca-trust/source/anchors so the server certificate can trusted by ssl clients. So, for example, when I curl https://<server> the certificate is trusted automatically.

Is there any way to make a java application to trust the certificates installed on the system?

Is the only way to make it works in java adding the certificate to the jvm truststore?

Regards

like image 726
althor Avatar asked Nov 26 '22 02:11

althor


1 Answers

I don't know any out of the box solutions for that. I think there're multiple ways to reach your goal:

  1. Write a class to sync you defined trust store and the cert directory
  2. Write an own TrustManager implementation which is based on the cert directory
like image 86
asbachb Avatar answered Mar 11 '23 07:03

asbachb