(DataFlex) Example: Http.GetServerCert method
Demonstrates how to call the GetServerCert method. Note: This example requires Chilkat v11.0.0 or greater.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Variant vCert
Handle hoCert
Boolean iSuccess
String sTemp1
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Get Create (RefClass(cComChilkatCert)) To hoCert
If (Not(IsComObjectCreated(hoCert))) Begin
Send CreateComObject of hoCert
End
Get pvComObject of hoCert to vCert
Get ComGetServerCert Of hoHttp "chilkatsoft.com" 443 vCert To iSuccess
If (iSuccess = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComSubjectDN Of hoCert To sTemp1
Showln sTemp1
Get ComValidToStr Of hoCert To sTemp1
Showln sTemp1
End_Procedure
|