Sample code for 30+ languages & platforms
PowerBuilder

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Http
oleobject loo_Cert

li_Success = 0

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if
loo_Cert = create oleobject
li_rc = loo_Cert.ConnectToNewObject("Chilkat.Cert")

li_Success = loo_Http.GetServerCert("chilkatsoft.com",443,loo_Cert)
if li_Success = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Cert
    return
end if

Write-Debug loo_Cert.SubjectDN
Write-Debug loo_Cert.ValidToStr

// Output:

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


destroy loo_Http
destroy loo_Cert