title: how to resolve the error "Bad request .Combination of host and port requires TLS."
body: <p>I am trying to consume a  rest end point but i am getting the below error</p>
  <blockquote>
  <p>Bad request .Combination of host and port requires TLS.</p>
  </blockquote>
  <p>This is the code i have written</p>
  <pre><code>GET_URL =&quot;https:/path/data&quot;
      URL obj = new URL(GET_URL);
              HttpURLConnection con = (HttpURLConnection) obj.openConnection();
              con.setRequestMethod(&quot;GET&quot;);
              int responseCode = con.getResponseCode();
              System.out.println(&quot;GET Response Code :: &quot; + responseCode)
  </code></pre>
  <p>Below code is from other team who is exposing the rest end point.
  Rest End point has SSL enabled.when i checked the code it says</p>
  <pre><code>@RestController
  public class TestController {
      @RequestMapping(value = &quot;/data&quot;, method = RequestMethod.GET)
      public String getData() {
          
          return &quot;Hello World&quot;;
      }
  
  server:
    ssl:
      enabled: true
      client-auth: need
      key-store: {keystore-path}
      key-store-password: {keystore-password}
      key-alias: alias-name
      key-store-type: JKS
  </code></pre>
  <p>How can i solve the error? Can you provide the steps</p>