中国服务器网

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

尝试通过SSL连接到服务器的SSLHandshakeException

我试图从Java / Spring 4应用程序通过SSL向远程服务器上的资源发出GET请求。 说资源是: HTTPS://remote-app/foo.pdf 我的应用程序使用https://github.com/square/okhttp作为HTTP客户端来执行操作。 不幸的是,这个资源正在抛出一个例外。 但令人惊讶的是,在其他服务器上通过SSL公开的其他资源成功。 这是我得到的例外: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[na:1.8.0_51] at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) ~[na:1.8.0_51] at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023) ~[na:1.8.0_51] at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125) ~[na:1.8.0_51] at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) ~[na:1.8.0_51] at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) ~[na:1.8.0_51] at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) ~[na:1.8.0_51] at com.squareup.okhttp.internal.http.SocketConnector.connectTls(SocketConnector.java:103) ~[okhttp-2.4.0.jar!/:na] at com.squareup.okhttp.Connection.connect(Connection.java:143) ~[okhttp-2.4.0.jar!/:na] at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:185) ~[okhttp-2.4.0.jar!/:na] at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128) ~[okhttp-2.4.0.jar!/:na] at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:341) ~[okhttp-2.4.0.jar!/:na] at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330) ~[okhttp-2.4.0.jar!/:na] at […]