JavaFX WebView HTTP2Loader set custom HostnameVerifier

84 Views Asked by At

As described in this answer, when trying to accept self-signed certificates with the JavaFX WebView, the HTTP2Loader ignores method calls like

  • HttpsURLConnection.setDefaultSSLSocketFactory()
  • HttpsURLConnection.setDefaultHostnameVerifier()

While there is a workaround to accept self-signed certificates by setting the default SSLContext via SSLContext.setDefault() and injecting an all-trusting trust manager (which replaces HttpsURLConnection.setDefaultSSLSocketFactory()), I can't find a way to set a custom HostnameVerifier (i.e. replacing HttpsURLConnection.setDefaultHostnameVerifier()). Is there a way to do this, or is the only possible option not to use the HTTP2Loader?

0

There are 0 best solutions below