Same url if i load in browser it gives certificate expired warring.This certificate expired status causes your issue.
Strictly speaking, because the certificate is expired, the connection is untrustworthy and the Java networking layer does not let the user use the connection.
The browser is also detecting the expired certificate, but instead of refusing the connection, it pops up a warning and allows the user to continue regardless if they wish. Replicating the browser behavior in Java by adding custom url handlers to the network layer and an interstitial page when an invalid connection is detected may be possible, but would likely prove difficult for you. Certainly, when I created a sample browser in JavaFX, I did not try to implement such a mechanism due to the potential difficulty and security implications of doing so.
The best solution is for the server maintainer to upgrade the certificate on their service to a valid one. I understand that you may have little control over that process.
If you google around, you may find solutions which allow you to disable certificate validity checking for java networking connections. These will likely allow WebView to connect to the target site, but, before enabling such a scheme, make sure you understand the security implications of doing so.
Thank you for your response. I have figured some things but still having issue.
The url that I was trying to load was has self signed certificated created using openssl. To try an example in apache webserver (WAMP) added an self signed certificate url (https://localhost).
I add the certificate to cacerts in the JRE security folder using the using the keytool(C:\Program Files\Java\jdk1.7.0_11\jre\lib\security\cacerts) (keytool -import -keystore c:/"Program Files"/java/jdk1.7.0_11/jre/lib/security/cacerts -file c:/www.amicusac.der).
I ran the application with webview localhost works fine but the https://localhost does load again in the webview.
Here the certificate is new one and not expired & I have added it to the cacerts in JRE security folder but also its not loading. Is there anything I am doing wrong in added the self signed certificate to the JRE. Can you please let me know
I am running the application in netbeans. The library & platform is C:\Program Files\Java\jdk1.7.0_1. I have updated the certifacte under this JRE it self.
The links that I have used.
WAMP for self signed certifiacte
To added certificate to cacerts
Thanks in advance
What is the point of running https with a self signed certificate on localhost? Especially if it is causing you difficulties? https is a transport layer protocol designed to protect information from man in the middle attacks as data transfers across a network. If everything is local to a single machine, it's useless as far as I know and you may as well just use plain http instead - in which case you don't need to solve any of these issues.
I was trying to test what exactly is the issue. when I was trying to load URL which is not localhost its not loading, that's why I created the self signed certificate which expires in 365 days and added to apache server in localhost and testing it.
But the issue is resolved when I added the certificate of the URL that I want to load to the JRE cacerts it loaded in the JavaFX webview and its working fine.
Is there any program that if there is an new certificate from url we added it to cacerts in JRE security folder.
Thank you for response and time.
Is there any program that if there is an new certificate from url we added it to cacerts in JRE security folder.If you are going to add every certificate you encounter to the trust store, you may as well just disable certificate checking or use plain http instead.
Just google for: "java disable certificate validation"
I am working on Javafx Webiew in swing application.
Generally if I load that URL in chrome browser and hit submit, it show error for required fields of the form. But its not working in the webview.
I have tested by enabling the firebug, the java scripts get loaded but the validation is not done.
Can you let me know is there anything that I need to enable to execute the scripts loaded from the URL to work in the webengine
Can you give me suggestion what might be the problem.
@user13425887 your new question is not related to the original question. Create a new question. In your new question include a sample app, sample URL and reproduction steps or you will be unable to get help.
I have created new question added more details about the issue. The HTML 5 attribute required is not working in javafx webview webengine.
the link to the new thread.
Thank you for your help in advance