Android上的SSL连接握手失败

时间:2016-05-24 11:06:50

标签: java android ssl https tls1.2

我是我的应用程序,我尝试从android上的SSL连接下载,下面是我的代码

 String url = "https://mysslconnection/xxx/xxx/xxx/xx";

        try{
            URL urlObj = new URL(url);
            HttpsURLConnection connection = (HttpsURLConnection)urlObj.openConnection();

            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));

            while(null != (strStoreList = reader.readLine())){
                System.out.println(strStoreList);
            }

        }
        catch (Exception e){
            String exception = e.getMessage();
            System.out.println(exception);

        }

我遇到异常 - 握手失败。我不知道如何修复它所以我从互联网搜索,我可以看到很多主题。但我想从头开始研究如何设置ssl连接,使用密钥库,创建SSLSocketFactory ......任何人都可以推荐文档或链接吗?我从android develop https://developer.android.com/training/articles/security-ssl.html读过一个 但这还不够。

0 个答案:

没有答案
相关问题