kt3k / coveralls-gradle-plugin

👨‍🔧 gradle plugin for coveralls
https://plugins.gradle.org/plugin/com.github.kt3k.coveralls
MIT License
253 stars 54 forks source link

javax.net.ssl.SSLException: hostname in certificate didn't match: #24

Closed Thuseeman25 closed 10 years ago

Thuseeman25 commented 10 years ago

This is the web client class StringBuilder responseStr = new StringBuilder();

    try {
        HttpResponse response = null;

        if (method == "GET") {
            HttpGet httpGet = new HttpGet(urlStr);

            response = HttpConnectionManager.getClient().execute(httpGet);
        } else if (method == "POST") {
            HttpPost httpPost = new HttpPost(urlStr);

            response = HttpConnectionManager.getClient().execute(httpPost);
        }

        InputStream responseInputStream = response.getEntity().getContent();
        BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(responseInputStream));

        String responseLineStr = null;

        while ((responseLineStr = bufferedReader.readLine()) != null) {
            responseStr.append(responseLineStr);
        }

        bufferedReader.close();
        responseInputStream.close();
    } catch (Exception e) {
        e.printStackTrace();
    }

    return responseStr.toString();
}

this is the doInBackground process

@Override
    protected String doInBackground(Void... params) {
        try {

            // String urlString = RequestMethods.callHTTPMethod("GET",
            // getResources().getString(R.string.url_main_products));

            String urlString = RequestMethods
                    .callHTTPMethod(
                            "GET",
                            getResources().getString(R.string.url_main_products));
            return urlString;

        } catch (IOException e) {
            e.printStackTrace();
        } catch (NotFoundException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

When I am trying to get the details from the service I got the issue like attached image screen shot 2014-09-29 at 2 23 56 pm

kt3k commented 10 years ago

Maybe you need to set an appropriate hostname verifier to your https client, as mentioned in this link, for example. But I'm afraid this is irrelevant to this plugin.

kt3k commented 10 years ago

Close this for the moment.

If you still think this is the issue of this plugin, please reopen this or raise another one.