Java
Chilkat2 Java
Require that the Web Server's SSL Certificate is Non-Expired and the Signature is Valid
Demonstrates setting the RequireSslCertVerify property to require that the web server's SSL/TLS certificate is non-expired and that the certificate's signature is valid.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Http;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat HTTP API to have been previously unlocked.
// See Global Unlock Sample for sample code.
String url = "https://chilkatsoft.com";
Http http = new Http();
http.setRequireSslCertVerify(true);
String html;
try {
html = http.quickGetStr(url);
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
System.out.println("Success.");
}
}