use of com.wavefront.agent.tls.NaiveTrustManager in project java by wavefrontHQ.
the class PushAgentTest method init.
@BeforeClass
public static void init() throws Exception {
TrustManager[] tm = new TrustManager[] { new NaiveTrustManager() };
SSLContext context = SSLContext.getInstance("SSL");
context.init(new KeyManager[0], tm, new SecureRandom());
sslSocketFactory = context.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier((h, s) -> h.equals("localhost"));
}
Aggregations