【发布时间】:2014-12-01 21:56:19
【问题描述】:
我正在使用 WizTool.org 的 RESTClient v3.4.2 来测试 Windows 2012 设备 IIS 8.0 上的远程 .NET 端点。
我已经多次使用此工具在本地机器上以调试模式调试相同的 REST 服务,但这是我第一次尝试在实际生产服务器上使用它。 (嗯,它实际上是一个 QA 服务器,但足够接近。)我过去和现在所做的主要区别在于,在我的本地开发盒上,我没有 SSL 证书,所以一切都完成了带有 HTTP 网址。在 QA 服务器上,我们有一个证书,所以我使用的是 HTTPS。
我收到此错误:
peer not authenticated
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:339)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:123)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
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.wiztools.restclient.HTTPClientRequestExecuter.execute(HTTPClientRequestExecuter.java:303)
at org.wiztools.restclient.ui.RESTView$26.run(RESTView.java:1061)
我找到了这两个与此错误相关的线程,但都没有提供任何线索:
peer not authenticated in web service?
Peer not authenticated exception while consuming https REST service
我还发现这个线程更直接地解决了我正在使用的工具,但我不确定我是否遵循建议的解决方案。从头开始...我确定我不理解建议的解决方案。
https://code.google.com/p/rest-client/issues/detail?id=135
在 RESTClient 工具的 SSL > 常规选项卡中,我使用了“信任自签名证书”和“主机名验证器”的所有组合。没运气。 (服务器使用的是完整的通配符证书,所以我不认为“信任自签名证书”有任何影响。)
在 IIS 中,我还将证书的副本导出到 .pfx 文件(带有密码),然后在 RESTClient 工具中,SSL > Truestore / Keystore,我导入了该文件。还是没有运气。
有什么想法吗?
谢谢!
【问题讨论】:
标签: .net rest authentication iis