code: private HttpURLConnection createConnection() {
          String urlString = getRequestInfo().getRequestUrl().toString();
          if( getRequestInfo().requestMethod == null ) {
              throw new KieServerHttpRequestException("Please specify (and execute?) a HTTP method first.");
          }
          try {
              final HttpURLConnection connection;
              if( this.httpProxyHost != null ) {
                  Proxy proxy = new Proxy(HTTP, new InetSocketAddress(this.httpProxyHost, this.httpProxyPort));
                  connection = CONNECTION_FACTORY.create(getRequestInfo().getRequestUrl(), proxy);
              } else {
                  connection = CONNECTION_FACTORY.create(getRequestInfo().getRequestUrl());
              }
              // support for localhost and https
              if (getRequestInfo().getRequestUrl().getProtocol().equalsIgnoreCase("https") && getRequestInfo().getRequestUrl().getHost().equalsIgnoreCase("localhost")) {
                  ((HttpsURLConnection) connection).setHostnameVerifier(new HostnameVerifier(){
  
                      public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
                          if (hostname.equalsIgnoreCase("localhost")) {
                              return true;
                          }
                          return false;
                      }
                  });
              }
  
              connection.setRequestMethod(getRequestInfo().requestMethod);
              return connection;
          } catch( IOException ioe ) {
              throw new KieServerHttpRequestException("Unable to create (" + getRequestInfo().requestMethod + ") connection to '"
                      + urlString + "'", ioe);
          }
      }
docs: Connection methods --------------------------------------------------------------------------------------------------------