私はコードの下
DesiredCapabilities cap = DesiredCapabilities.chrome();
ImmutableMap<String, String> commandLineArguments = ImmutableMap.<String,
String>builder()
.put("web-security", "false")
.put("ssl-protocol", "any")
.put("ignore-ssl-errors", "true")
.put("webdriver-loglevel", "DEBUG")
.put("ssl-client-certificate-file", certificatePath)
.put("ssl-client-key-passphrase", certificatePassword)
.build();
String[] params = commandLineArguments.entrySet().stream()
.map(e -> String.format("--%s=%s", e.getKey(), e.getValue()))
.collect(Collectors.toList())
.toArray(new String[0]);
cap.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, params);
cap.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new PhantomJSDriver(cap);
driver.get(Url);
でこの問題を解決しましたしかし、私は持っていました以下のコマンドを使用して自分のpfx証明書をpemに変換する
openssl pkcs12 -in client_ssl_cert.pfx -out client_ssl_cert.pem -clcerts
問題は、実際にアクセスしようとしているサイトにクライアント証明書がインストールされていることです。私たちはより多くのテスト環境を持っているので、各環境には特定の証明書が必要です。 –
スタンドアロンのSeleniumサーバーを使用してコマンドラインからこれを行うにはどうすればよいですか? – B2K
@PavelJanicekはこの問題を解決できました。どのような証明書をクロームドライバで選択するのか – Manvi