0
我正在使用最新的JBrowserDriver:https://github.com/MachinePublishers/jBrowserDriver。JBrowserDriver主機名稱與主體提供的證書主體不匹配
我想消除「主機名'foobar'與主體提供的證書主題不匹配」異常。這是我做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);
...
}
有沒有辦法做JBrowserDriver類似的東西?