source: trunk/Packages/synapse/source/demo/FreePascal/testssl.pas

Last change on this file was 2, checked in by chronos, 12 years ago
  • Přidáno: Základní kostra projektu.
  • Přidáno: Knihovna synapse.
File size: 880 bytes
Line 
1{$MODE DELPHI}
2
3Program testssl;
4
5uses
6 blcksock, synassl;
7
8var
9 sock: TTCPBlockSocket;
10begin
11 sock := TTCPBlockSocket.create;
12 try
13 sock.SSLEnabled:=True;
14 writeln('Used OpenSSL library:');
15 writeln(SSLLibFile);
16 writeln(SSLUtilFile);
17 sock.Connect(paramstr(1),paramstr(2));
18 if sock.lasterror <> 0 then
19 begin
20 writeln('Error connecting!');
21 exit;
22 end;
23 writeln;
24 writeln('SSL version: ', sock.SSLGetSSLVersion);
25 writeln('Cipher: ', sock.SSLGetCiphername);
26 writeln('Cipher bits: ', sock.SSLGetCipherBits);
27 writeln('Cipher alg. bits: ', sock.SSLGetCipherAlgBits);
28 writeln('Certificate verify result: ', sock.SslGetVerifyCert);
29 writeln('Certificate peer name: ', sock.SSLGetPeerName);
30 writeln(sock.SSLGetCertInfo);
31 sock.closesocket;
32 finally
33 sock.free;
34 end;
35end.
36
Note: See TracBrowser for help on using the repository browser.