Code changes to ignore certificate validation errors, ignoring trust verification at all (for example, using a trust manager that does nothing) are generally not suitable for the correct path. They may be popular with some developers because they donβt need to go through any steps to work with certificates, but they just ignore the problem and not fix it, thereby also introducing vulnerabilities into MITM attacks. (Since the problem is then disabled, it is never fixed in product releases.)
Various ways to configure traffic control are described in the JSSE Reference Guide .
In short, you can either explicitly import certificates into the JRE trust store (usually the cacerts file in the JRE directory) or by importing it into your own trust store (possibly based on a copy of the default trust store) and specifying its path using the javax.net.ssl.trustStore properties javax.net.ssl.trustStore (and related) systems (see the JSSE Ref. Guide).
These configuration parameters will affect all SSLSocket and SSLEngine , which themselves use the default settings (without any specific SSLContext in the code).
Some applications use their own SSLContext to load a specific keystore or trust store for specific connections. This is usually configured with parameters that are independent of the default JSSE parameters, in which case you will need to check the documentation or application code.
Bruno source share