我正在尝试与Vantiv Litle网关集成。我从服务器下载了集成jar文件。尝试使用这些罐子会引发以下错误:
Exception in thread "main" com.litle.sdk.LitleOnlineException: Exception connection to Litle
at com.litle.sdk.Communication.requestToServer(Communication.java:75)
at com.litle.sdk.LitleOnline.sendToLitle(LitleOnline.java:679)
at com.litle.sdk.LitleOnline.authorize(LitleOnline.java:153)
at com.litle.sdk.LitleOnline.authorize(LitleOnline.java:145)
at com.example.LitleAuthUnedited.main(LitleAuthUnedited.java:82)
Caused by: javax.net.ssl.SSLException: hostname in certificate didn't match: <208.70.177.61> != <prelive.litle.com>
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:220)
at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:149)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:130)
at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:399)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554)
at com.litle.sdk.Communication.requestToServer(Communication.java:64)
... 4 more
经过一番研究,我了解到这与证书发行有关。我试图将Litle的证书安装到jdk中的“ jssecacerts”文件中,但无法解决问题。
此外,我尝试添加无法解决的具有ip和dns名称映射的主机文件条目。
我可以通过编辑Litle的jar文件并在发布期间添加“ allow_all_hostname_verifier”来使其工作。但是,由于我必须编辑jar文件,因此无法遵循此方法,因此不建议使用此方法。
有人可以建议我该如何解决吗?
谢谢,
Harika
最佳答案
此行例外:
Caused by: javax.net.ssl.SSLException: hostname in certificate didn't match: <208.70.177.61>
似乎暗示您正在尝试使用如下URL来访问服务器:
https://208.70.177.61/
SSL证书通常与域绑定,通常与主机名绑定。尝试使用真实的主机名,例如:
https://prelive.litle.com/