我的程序在任何网络(家庭)等都运行良好但不会在我的工作域上运行。 该程序登录surveymonkey.com并下载和Excel电子表格。但我的工作域似乎不喜欢我的import语句。我猜我需要输入根证书,但我不知道该怎么做。 这是我无法解决的错误。
Warning! About to Delete Survey Results.zip & Survey Results Folder Warning!
waiting for 10 seconds...
deleting previous zip file...
no file to delete.
connecting to surveymonkey logon page...
Exception in thread "main" javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:397)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
at com.gargoylesoftware.htmlunit.HtmlUnitSSLSocketFactory.connectSocket(HtmlUnitSSLSocketFactory.java:171)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:171)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1484)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1402)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:304)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:373)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:358)
at surveymonkeytest.Surveymonkeytest.main(Surveymonkeytest.java:107)
答案 0 :(得分:0)
工作jdk在cacerts文件中是否与home jdk具有相同的证书?如果没有,您将必须从远程站点下载证书(在firefox中查看页面信息,安全表,查看证书,详细信息,证书层次结构,导出),然后keytool将其导入您正在运行的jdk中你的申请来自。