Support "trust all" SSL context in OpenJFX 14

Lior Yaffe lior.yaffe at jelurida.com
Tue Apr 7 13:30:08 UTC 2020


I'm not sure why but it doesn't work.

The only workaround I found is:
System.setProperty("com.sun.webkit.useHTTP2Loader", "false"); // Workaround
to support test certificate with OpenJFX 14 Webview

Then use the old code which works in OpenJFX 13 and earlier.
HttpsURLConnection.setDefaultSSLSocketFactory(TrustAllSSLProvider.getSslSocketFactory());
HttpsURLConnection.setDefaultHostnameVerifier(TrustAllSSLProvider.getHostNameVerifier());

On Tue, Apr 7, 2020 at 2:28 PM Michał Zegan <webczat_200 at poczta.onet.pl>
wrote:

> What about global SSLContext.setDefault()? maybe it doesn't apply of
> course.
>
> W dniu 07.04.2020 o 13:14, Lior Yaffe pisze:
> > Some background information on why we are facing the issue.
> > The internal implementation of WebView changed in OpenJFX 14 to use
> > HttpClient instead of Http(s)URLConnection. Therefore, it is no longer
> > possible to use the following methods to set a custom SSL context before
> > instantiation of a HttpsURLConnection object:
> >
> > HttpsURLConnection#setDefaultSSLSocketFactory
> > HttpsURLConnection#setDefaultHostnameVerifier
> >
> > The only way to set a custom SSLContext to a HttpClient is to use the
> > method HttpClientBuilder#sslContext unfortunately this method is not
> > accessible for the Webview code.
> >
> > Since there is no static method on the HttpClient to set a custom
> > SSLContext, we hereby request to introduce a public method on WebView (or
> > WebEngine) for the purpose of passing a custom SSL context.
> >
> > <
> http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> > Virus-free.
> > www.avg.com
> > <
> http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> >
> > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
>


More information about the openjfx-dev mailing list