login about faq

I am using Chilkat to verify Verify SSL Server Certificate for credit card merchant warehouse API. I want to use TLS server connection fro credit card. Currently I am using your codebase in application. I want to change it by TLS connection. Could you provide any guidance?

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, CHILKATCERTIFICATELib_TLB, CHILKATSOCKETLib_TLB, OleCtrls;

...

procedure TForm1.Button1Click(Sender: TObject); var socket: TChilkatSocket; success: Integer; ssl: Integer; maxWaitMillisec: Integer; sslServerHost: String; sslServerPort: Integer; cert: CHILKATSOCKETLib_TLB.IChilkatCert; bExpired: Integer; bRevoked: Integer; bSignatureVerified: Integer; bTrustedRoot: Integer;

begin socket := TChilkatSocket.Create(Self);

success := socket.UnlockComponent('Anything for 30-day trial'); if (success <> 1) then begin Memo1.Lines.Add(socket.LastErrorText); Exit; end;

ssl := 1; 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 <> 1) then begin Memo1.Lines.Add(socket.LastErrorText); Exit; end;

cert := socket.GetSslServerCert() As CHILKATSOCKETLib_TLB.IChilkatCert; if (not (cert = nil )) then begin

Memo1.Lines.Add('Server Certificate:');
Memo1.Lines.Add('Distinguished Name: ' + cert.SubjectDN);
Memo1.Lines.Add('Common Name: ' + cert.SubjectCN);
Memo1.Lines.Add('Issuer Distinguished Name: '
     + cert.IssuerDN);
Memo1.Lines.Add('Issuer Common Name: ' + cert.IssuerCN);

bExpired := cert.Expired;
bRevoked := cert.Revoked;
bSignatureVerified := cert.SignatureVerified;
bTrustedRoot := cert.TrustedRoot;

Memo1.Lines.Add('Expired: ' + IntToStr(bExpired));
Memo1.Lines.Add('Revoked: ' + IntToStr(bRevoked));
Memo1.Lines.Add('Signature Verified: ' + IntToStr(bSignatureVerified));
Memo1.Lines.Add('Trusted Root: ' + IntToStr(bTrustedRoot));

end;

// Close the connection with the server // Wait a max of 20 seconds (20000 millsec) socket.Close(20000);

end;

asked Nov 18 '14 at 09:36

VikasDelphi's gravatar image

VikasDelphi
11

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×56

Asked: Nov 18 '14 at 09:36

Seen: 826 times

Last updated: Nov 18 '14 at 09:36

powered by OSQA