Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL oCert

nSuccess := 0

oHttp := CreateObject("Chilkat.Http")
oCert := CreateObject("Chilkat.Cert")

nSuccess := oHttp:GetServerCert("chilkatsoft.com", 443, oCert)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oCert:destroy()
    RETURN
ENDIF

? oCert:SubjectDN
? oCert:ValidToStr

//  Output:

//  CN=*.chilkatsoft.com
//  Wed, 10 Jun 2026 23:59:59 GMT

oHttp:destroy()
oCert:destroy()