Code example for HttpsURLConnection

Methods: setHostnameVerifier

0
    HostnameVerifier hostnameVerifier
      = CurlHostnameVerifier.create(curl.getIsVerifySSLPeer(),
                                    curl.getIsVerifySSLCommonName(),
                                    curl.getIsVerifySSLHostname());
     
    conn.setHostnameVerifier(hostnameVerifier);
 
    setConnection(conn);
  } 
   
  /** 
   * Connects to the server. 
   */ 
  /* 
  @Override 
  public void connect(CurlResource curl) 
    throws ConnectException, ProtocolException, SocketTimeoutException, 
            IOException 
  { 
    try { 
Experience pair programming with AI  Get Codota for Java