Using a custom truststore in java as well as the default one with SSLContext setDefault
In this video we are going to setup truststore load certificates in it programmatically and then include all the certificates from JDK default lib/security/cacerts bundle as well and then set our truststore as default via SSLContext.setDefault method.
0:17 What is a cacert file
1:55 Location of cacerts file in JDK 8, 11, 18
2:25 Please Like and Subscribe!
2:33 What is SSLContext
4:41 Example of impact of setting SSLContext.setDefault method in shared JVM
7:49 Example project that shows how to create truststore programatically and set it via SSLContext.setDefault
8:14 First testcase that shows PKIX Exception for untrusted root certificate
9:36 Second test case that creates truststore programatically and then calls URL with untrusted root certificate
11:20 Third test case that calls google.com but gets PKIX exception since using custom truststore cleared the default certs
11:52 Fourth test case that uses cacerts and calls google.com
12:50 Explanation of @BeforeClass annotation in Junit which keeps a copy of SSLContext and @Before annotation method resets the SSLContext.setDfault so that each test case can run properly
14:46 Test case that covers code that adds custom SSL certificate to truststore including the default cacerts certificate bundle.
Example Project Code:
https://github.com/chandnarahul/impor...
This video covers:
How to create truststore and retain all cacerts certificates in it
How to create truststore and include all cacert certificates in it
How to create truststore and add all JDK cacert certificates in it
Using a custom truststore in java as well as the default one
How to create a certificate store from existing certificates in Java
Add custom SSL certificate to truststore but retain the default cacerts in Java
Supporting Links:
https://untrusted-root.badssl.com/
https://www.websecurity.digicert.com/...
Google Searches:
https://stackoverflow.com/questions/2...
https://stackoverflow.com/questions/4...
https://stackoverflow.com/questions/2...
En esta página del sitio puede ver el video en línea Java programmatically add custom trusted + default certificates using SSLContext setDefault de Duración hora minuto segunda en buena calidad , que subió el usuario Rahul Random Learnings 05 febrero 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 3,127 veces y le gustó 40 a los espectadores. Disfruta viendo!