I am using the latest JBrowserDriver from here: https://github.com/MachinePublishers/jBrowserDriver.
I want to eliminate the "Host name 'foobar' does not match the certificate subject provided by the peer" exception. Here's what I do with org.apache.http.HttpClient:
TrustStrategy trustStrategy = new TrustSelfSignedStrategy();
SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(trustStrategy).build();
HostnameVerifier hostnameVerifier = NoopHostnameVerifier.INSTANCE;
StatusLine statusLine;
try (CloseableHttpClient httpclient = HttpClients.custom().setSSLContext(sslContext).setSSLHostnameVerifier(hostnameVerifier).build()) {
HttpGet httpGet = new HttpGet(deviceStatusURI);
...
}
Is there a way to do something similar with JBrowserDriver?