Sample code for 30+ languages & platforms
Lianja

Transition from Http.GetServerSslCert to Http.GetServerCert

See more HTTP Examples

Provides instructions for replacing deprecated GetServerSslCert method calls with GetServerCert.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loHttp = createobject("CkHttp")
lcDomain = "chilkatsoft.com"
lnPort = 443

// ------------------------------------------------------------------------
// The GetServerSslCert method is deprecated:

loCert1 = loHttp.GetServerSslCert(lcDomain,lnPort)
if (loHttp.LastMethodSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    return
endif

? loCert1.SubjectDN
release loCert1

// ------------------------------------------------------------------------
// Do the equivalent using GetServerCert.
// Your application creates a new, empty certificate object which is passed 
// in the last argument and filled with the server certificate upon success.

loCert2 = createobject("CkCert")
llSuccess = loHttp.GetServerCert(lcDomain,lnPort,loCert2)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loCert2
    return
endif

? loCert2.SubjectDN


release loHttp
release loCert2