0

I have a project which post the rest request and read back the response. with http the function is working fine. But when I use https, I am getting connection refused error. gradle is the build tool here and I added gradle.properties under projectdir, but still I am getting connection refused error.

    HttpPost post = new HttpPost(RequestURL);

    StringEntity input = new StringEntity(Payload);

    post.setEntity(input);

    HttpResponse response = client.execute(post);`

gradle.properties add under Project>gradle.properties

   systemProp.https.proxyHost=www.somehost.org
   systemProp.https.proxyPort=8080
   systemProp.https.proxyUser=userid
   systemProp.https.proxyPassword=password

When I added gradle.properties for the first time, it was working, but suddenly started throwing this connection refused error.

K V
  • 95
  • 9

1 Answers1

0

The properties You defined in gradle.properties are set for gradle itself - e.g. when it needs to download dependencies via proxy.

You should define all stuff required for https in code itself.

Opal
  • 81,889
  • 28
  • 189
  • 210