tags:

views:

36

answers:

0

I am trying to connect WebServices using HTTPS in Android but I keep getting this error. Is there a way to fix it?

                URL url = new URL(urlString);
                Log.d("SSLDemo", "Setting hostname verifier");
                startProgressSpinner();
                HttpsURLConnection.setDefaultHostnameVerifier(new AllowAllHostnameVerifier());
                HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
                conn.setHostnameVerifier(new AllowAllHostnameVerifier());
                conn.setFixedLengthStreamingMode(soapReqBody.length());
                conn.setRequestMethod("POST");
                conn.setDoInput( true );
                conn.setDoOutput( true );

                OutputStream out = conn.getOutputStream();

                Writer wout = new OutputStreamWriter(out);

                wout.write(soapReqBody);
                wout.flush();
                wout.close();

                // Get the response
                rd = new BufferedReader(
                        new InputStreamReader(conn.getInputStream()));

soapReqBody is basically soap request XML. I came across many people mentioning FakeTrustManager but cannot find something in details. Can anyone show me some resource.