Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Excel) Verify SSL Server CertificateDemonstrates how to connect to an SSL server and verify its SSL certificate.
' This example requires the Chilkat API to have been previously unlocked. ' See Global Unlock Sample for sample code. Dim socket As Chilkat.Socket Set socket = Chilkat.NewSocket ssl = True maxWaitMillisec = 20000 ' The SSL server hostname may be an IP address, a domain name, ' or "localhost". sslServerHost = "www.paypal.com" sslServerPort = 443 ' Connect to the SSL server: success = socket.Connect(sslServerHost,sslServerPort,ssl,maxWaitMillisec) If (success <> True) Then Debug.Print socket.LastErrorText Exit Sub End If Set cert = socket.GetSslServerCert() If (socket.LastMethodSuccess <> False) Then Debug.Print "Server Certificate:" Debug.Print "Distinguished Name: "; cert.SubjectDN Debug.Print "Common Name: "; cert.SubjectCN Debug.Print "Issuer Distinguished Name: "; cert.IssuerDN Debug.Print "Issuer Common Name: "; cert.IssuerCN bExpired = cert.Expired bRevoked = cert.Revoked bSignatureVerified = cert.SignatureVerified bTrustedRoot = cert.TrustedRoot Debug.Print "Expired: "; bExpired Debug.Print "Revoked: "; bRevoked Debug.Print "Signature Verified: "; bSignatureVerified Debug.Print "Trusted Root: "; bTrustedRoot End If ' Close the connection with the server ' Wait a max of 20 seconds (20000 millsec) success = socket.Close(20000) |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.