相关疑难解决方法(0)

SSLHandShakeException没有适当的协议

我最近在我的网站上添加了SSL,可以通过https访问.现在,当我的java应用程序尝试向我的网站发出请求并使用缓冲读取器从中读取它时,它会生成此堆栈跟踪

我没有使用自签名证书,证书来自Namecheap,他使用COMODO SSL作为CA来签署我的证书.即时通讯使用java 8

javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.Handshaker.activate(Handshaker.java:503)
at sun.security.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1482)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1351)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
Run Code Online (Sandbox Code Playgroud)

我的代码非常基本,只是尝试使用缓冲读取器在我的网站上阅读页面

 private void populateDataList() {
    try {
        URL url = new URL("https://myURL.com/Data/Data.txt");
        URLConnection con = url.openConnection();
        con.setRequestProperty("Connection", "close");
        con.setDoInput(true);
        con.setUseCaches(false);

        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
        String line;
        int i = 0;
        while((line = in.readLine()) != null) {
            this.url.add(i, line);
            i++;
        }
    }   catch (Exception e) {
        e.printStackTrace();
    }

}
Run Code Online (Sandbox Code Playgroud)

我已经尝试将我的SSL证书添加到JVM的密钥库中,我甚至尝试使用此代码接受每个证书(这证明了我知道的SSL的目的)

 private …
Run Code Online (Sandbox Code Playgroud)

java ssl bufferedreader

8
推荐指数
7
解决办法
3万
查看次数

标签 统计

bufferedreader ×1

java ×1

ssl ×1