Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android 6上的SSL握手失败_Java_Android_Ssl_Ssl Certificate_Tls1.2 - Fatal编程技术网

Java Android 6上的SSL握手失败

Java Android 6上的SSL握手失败,java,android,ssl,ssl-certificate,tls1.2,Java,Android,Ssl,Ssl Certificate,Tls1.2,我需要通过https连接从网站获取内容。我已经使用下面的代码将网站与桌面应用程序连接起来,但在Android 6上失败了。我已经搜索了很多天,但是没有找到结果(我尝试添加中间CA和根CA,但结果相同)。请任何人帮帮我 String url = "https://www.coles.com.au"; try{ URL urlObj = new URL(url); HttpsURLConnection urlConnection =

我需要通过https连接从网站获取内容。我已经使用下面的代码将网站与桌面应用程序连接起来,但在Android 6上失败了。我已经搜索了很多天,但是没有找到结果(我尝试添加中间CA和根CA,但结果相同)。请任何人帮帮我

String url = "https://www.coles.com.au";
try{
            URL urlObj = new URL(url);
            HttpsURLConnection urlConnection =
                    (HttpsURLConnection)urlObj.openConnection();
            InputStream in = urlConnection.getInputStream();

            BufferedReader reader = new BufferedReader(new InputStreamReader(in));

            while(null != (content = reader.readLine())){
                System.out.println(strStoreList);
            }
        }
        catch (IOException e){
            String exception = e.getMessage();
            System.out.println(exception);
        }
以上代码以SSL握手异常结束-握手失败抛出