From: Ahmed A. <asa...@ya...> - 2014-12-10 16:06:37
|
Hi, The certificate is not trusted, you can use: webClient.getOptions().setUseInsecureSSL(true); Ahmed From: mahesh.sanka <mah...@es...> To: htm...@li... Sent: Tuesday, December 9, 2014 12:45 PM Subject: [Htmlunit-user] Error while accessing https web site Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.val idator.ValidatorException: PKIX path building failed: sun.security.provider.cert path.SunCertPathBuilderException: unable to find valid certification path to req uested target class Connect { public static void main(String[] args)throws Exception { final WebClient webClient = new WebClient(); //webClient.setRedirectEnabled(true); webClient.getOptions().setJavaScriptEnabled(false); webClient.getOptions().setCssEnabled(false); webClient.getOptions().setRedirectEnabled(true); final HtmlPage page1 = webClient.getPage("https://192.168.4.115/acsadmin/login.jsp"); final HtmlForm form = page1.getFormByName("cuesLoginForm"); final HtmlTextInput userName = form.getInputByName("j_username"); final HtmlTextInput password = form.getInputByName("j_password"); userName.setValueAttribute("acsadmin"); password.setValueAttribute("Passw0rd"); final HtmlSubmitInput button = form.getInputByName("cuesLoginSubmitButton"); final HtmlPage page2 = button.click(); webClient.closeAllWindows(); } } -- View this message in context: http://htmlunit.10904.n7.nabble.com/Error-while-accessing-https-web-site-tp35067.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |