Issue
I'm using JavaFX WebView to load a website. This website is using iframes.
It's working fine on a classical browser, but when I'm displaying the pages using JavaFX WebView, the frames are empty.
I tried to display the content of the iframe programmatically from the Java code (according to this: How to get by javafx webview content iframe loaded page?). It is empty.
I also tried to allow everything with Content Security Policy, X-Frame-Options, etc. on the client side (by overriding the HTTP headers), following JavaFX WebView disable Same origin policy (allow cross domain requests). It did not change anything.
I hava added a WebConsoleListener to see some logs. I have no errors.
What is the issue? Is there a way to get more logs?
Solution
It turns out that the issue was the following: the website in the iframe had an issue with the certificate chain (the whole certificate chain was not transmitted by the website in the iframe). The issue was identified using SSLLabs.
It's not a problem when accessing the page using a browser because browsers are able to manage the situation, but the sun JVM is not able to do so.
A SSL handshake exception was risen somewhere, but it was hidden by the JavaFX WebView (somewhere it was caught and not displayed clearly thereafter).
So once the issue is identified, to fix it we fall back to the traditional solutions:
- If possible, fix the website with the incomplete certificate chain (recommended)
- If not, either explicitly trust the certificate provided by the site by adding it to the cacerts file, or disable the SSL security (not recommended)
Answered By - Fitz