Xbase++ Requires Chilkat v11.0.0+
Xbase++
Transition from Http.GetServerSslCert to Http.GetServerCert
See more HTTP Examples
Provides instructions for replacing deprecated GetServerSslCert method calls with GetServerCert.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oHttp
LOCAL cDomain
LOCAL nPort
LOCAL oCert1
LOCAL oCert2
nSuccess := 0
oHttp := CreateObject("Chilkat.Http")
cDomain := "chilkatsoft.com"
nPort := 443
// ------------------------------------------------------------------------
// The GetServerSslCert method is deprecated:
oCert1 := oHttp:GetServerSslCert(cDomain, nPort)
IF (oHttp:LastMethodSuccess == 0)
? oHttp:LastErrorText
oHttp:destroy()
RETURN
ENDIF
? oCert1:SubjectDN
oCert1:destroy()
// ------------------------------------------------------------------------
// 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.
oCert2 := CreateObject("Chilkat.Cert")
nSuccess := oHttp:GetServerCert(cDomain, nPort, oCert2)
IF (nSuccess == 0)
? oHttp:LastErrorText
oHttp:destroy()
oCert2:destroy()
RETURN
ENDIF
? oCert2:SubjectDN
oHttp:destroy()
oCert2:destroy()