Ssl certificate 间歇性对等未通过身份验证-信任所有证书时

Ssl certificate 间歇性对等未通过身份验证-信任所有证书时,ssl-certificate,Ssl Certificate,神秘的“未经认证的对等方”列表中还有一个 我有一个使用4.2 lib的ApacheHttpClient。我已显式设置为信任代码中的所有证书。 我有一个Tomcat服务器(JRE 1.7U45),在Linux上为请求提供服务。服务器具有自签名证书 客户端代码: private DefaultHttpClient getHttpsClient() { try { SSLContext sslContext = SSLContext.getInstance("SSL");

神秘的“未经认证的对等方”列表中还有一个

我有一个使用4.2 lib的ApacheHttpClient。我已显式设置为信任代码中的所有证书。 我有一个Tomcat服务器(JRE 1.7U45),在Linux上为请求提供服务。服务器具有自签名证书

客户端代码:

private DefaultHttpClient getHttpsClient() {
    try {

        SSLContext sslContext = SSLContext.getInstance("SSL");
        final SSLSocketFactory sf;
        sslContext.init(null, new TrustManager[] { new X509TrustManager() {
            public X509Certificate[] getAcceptedIssuers() {
                return null;
            }

            public void checkClientTrusted(X509Certificate[] certs,
                    String authType) {
            }

            public void checkServerTrusted(X509Certificate[] certs,
                    String authType) {
            }
        } }, new SecureRandom());

        sf = new SSLSocketFactory(sslContext,
                SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme(url.getScheme(), url.getPort(), sf));

        ClientConnectionManager cm = new BasicClientConnectionManager(
                registry);

        return new MyDefaultHttpClient(cm);
    } catch (Exception e) {
        return new MyDefaultHttpClient();
    }
}
此错误仅在与服务器对话的“Solaris 5.10”(32位JRE 1.7.0u45)客户端上间歇性出现。
有时,同一个框上的请求可以正常通过,但在其他时候,这只是抛出“对等方不进行身份验证” 我有其他风格的操作系统客户端,在这些客户端中,通话可以正常进行。
你们有什么建议/建议来研究这个问题吗

更多更新: 在服务器上运行ssl调试,我们看到它间歇性地抛出 http-bio-8443-exec-7,处理异常:javax.net.ssl.SSLHandshakeException:无效填充长度:105
http-bio-8443-exec-7,getSession()中的IOException:javax.net.ssl.SSLHandshakeException:无效的填充长度:105这是由于JRE 1.7中的以下错误造成的

此外,ApacheHttpClient 4.2增加了混淆,它掩盖了实际抛出的异常,而不是抛出一般的“对等未验证”

在tomcat的server.xml中,对于connector元素,添加带有非DH密码列表的cipher属性 例如。 加密加密4 4 4 4 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 10沙,TLS S 10 10 10 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8乌沙“

这就解决了问题。 希望这对某人有用


谢谢

为什么这个问题会被降级?这是一个非常奇怪的问题,当我信任所有证书时,httpclient会失败吗?