JavaFX WebView and Client Certificate
<p>I am trying to port a .net application to JavaFx that has an integrated web browser that opens a website that requires a certificate. In windows the certificate was installed from a provided .pfx file and a pass phrase.
When the browser calls the website, a pop up shows the installed certificates, user chose the right one if there is more than one and website opens.
With the following code, I get the website to open connect using my certificate.</p>

<pre><code>private void Connect() throws NoSuchAlgorithmException, FileNotFoundException, KeyStoreException, IOException, CertificateException, UnrecoverableKeyException, KeyManagementException {
    SSLContext ctx = SSLContext.getInstance("TLS");
    KeyManager[] keyManagers;
    KeyStore keyStore = KeyStore.getInstance("pkcs12");
    FileInputStream keyStoreFile = new FileInputStream(new File("Certificate.pfx"));
    String keyStorePassword = "password";
    keyStore.load(keyStoreFile, keyStorePassword.toCharArray());
    KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
    kmf.init(keyStore, keyStorePassword.toCharArray());
    keyManagers = kmf.getKeyManagers();
    ctx.init(keyManagers, null, new SecureRandom());

    SSLSocketFactory sslSocketFactory = ctx.getSocketFactory();
    URL url = new URL("https://example.com");
    HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
    urlConnection.setSSLSocketFactory(sslSocketFactory);
    BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
    String inputLine;
    while ((inputLine = in.readLine()) != null) {
        System.out.println(inputLine);
    }
    in.close();
}
</code></pre>

<p>How can I get this working in WebView control?</p>

<p>Thanks</p>