I use javafx.scene.web.WebView. Other addresses are loaded, this one does not, gives an empty window. When I load in Google Chrome browser, a window pops up asking for a certificate, which I confirm and only after that the site loads. The certificate is added to the PC using the * .pfx file. How to make the address I need loaded via WebView javafx?

webEngine.load("https://www.**********.ru/"); 

upd certificate properties in chrome:

in the browser

    1 answer 1

    JDK 8 uses TLS 1.2 by default. Try using the first version:

     -Djdk.tls.client.protocols="TLSv1" 

    Still there is such a solution:

     TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType) { } public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType) { } } }; try { SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustAllCerts, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (GeneralSecurityException e) { } try { URL url = new URL("https://hostname/index.html"); } catch (MalformedURLException e) { } webEngine.load("https://example.com"); 
    • in the browser it says that the certificate uses TLS 1.2, but I will try. The second method did not help. I think you still need to point out the certificate directly, just as I don’t know - Nikolai Konorev
    • @NikolayKonorev superuser.com/questions/747377/… - Mstislav Pavlov