Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
HTTPS GET with Client CertificateSimple HTTPS GET request to download the HTML of a web page. Uses a client digital certificate for the SSL connection. uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, CHILKATHTTPLib_TLB, CHILKATCERTIFICATELib_TLB, OleCtrls; ... procedure TForm1.Button1Click(Sender: TObject); var http: TChilkatHttp; success: Integer; certStore: CHILKATCERTIFICATELib_TLB.IChilkatCertStore; cert: CHILKATHTTPLib_TLB.IChilkatCert; html: String; begin http := TChilkatHttp.Create(Self); // Any string unlocks the component for the 1st 30-days. success := http.UnlockComponent('Anything for 30-day trial'); if (success <> 1) then begin ShowMessage(http.LastErrorText); end; // Create an instance of a certificate store object, load a PFX file, // locate the certificate we need, and use it for signing. // (a PFX file may contain more than one certificate.) certStore := CoChilkatCertStore.Create(); // The 1st argument is the filename, the 2nd arg is the // PFX file's password: success := certStore.LoadPfxFile('tagtooga_secret.pfx','secret'); if (success <> 1) then begin ShowMessage(certStore.LastErrorText); end; cert := certStore.FindCertBySubjectE('admin@tagtooga.com') As CHILKATHTTPLib_TLB.IChilkatCert; if (cert = nil ) then begin ShowMessage(certStore.LastErrorText); end; http.SetSslClientCert(cert As CHILKATHTTPLib_TLB.IChilkatCert); // Send the HTTP GET and return the content in a string. html := http.QuickGetStr('https://www.paypal.com/'); Memo1.Lines.Add(http.LastErrorText); end; |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.