On Tue, 1 Jan 2019, paste...@gmx.com wrote:

works perfectly here with my self signed cert (test.pem)

I know that.

It works if you give it a file. That's not a problem.

But it does not work if you expect the server to generate a certificate 
on-the-fly.

(
just comment out all the assignments in unit http:
//  Sock.SSL.CertCAFile := ExtractFilePath(ParamStr(0)) + 's_cabundle.pem';
//  Sock.SSL.CertificateFile := ExtractFilePath(ParamStr(0)) + 's_cacert.pem';
//  Sock.SSL.PrivateKeyFile := ExtractFilePath(ParamStr(0)) + 's_cakey.pem';
//  Sock.SSL.KeyPassword := 's_cakey';
//  Sock.SSL.verifyCert := True;
)

See unit ssl_opensl,

function TSSLOpenSSL.CreateSelfSignedCert(Host: string): Boolean;

This function is erroneous.

After lots of searching, I found the problem.

function TSSLOpenSSL.CreateSelfSignedCert(Host: string): Boolean;

does a call Asn1UtctimeNew.

This function does not (or no longer) exists as a symbol in the openssl
library. It is now a macro that calls ASN1_STRING_type_new() or somesuch.

As a result, the certificate times are invalid, and the created certificate is 
invalid.
(at least the code should check that the functions have correctly returned
something?)

Attached are some diffs I made to fix the problem (I did the patch on an older 
version
of synapse, but made a diff from current SVN, so there is some noise in the
patch).

Essentially, it imports ASN1_STRING_type_new and the various ASN1 types, and lets Asn1UtctimeNew call ASN1_STRING_type_new with the correct type.

After applying this, the code creates a valid certificate on-the-fly.

But the problem then moves: at every request, a different certificate is
created, because the certificate is created as part of the TSSLOpenSSL.Accept
request.

The browser of course complains about this. The only solution is to
create the certificate once and set the data appropriately whenever a
connection is accepted.

But, in essence, generating a certificate on-the-fly now works (again).

I imagine at some point, the openssl people changed an actual call for a
macro, and synapse's import unit was not updated to match this change.

Michael.
258a276
>       ASN1UtcTimeSetString(t,PAnsiChar(FormatDateTime('YYMMDDHHNNSS',Now)));
--- ssl_openssl_lib.pas	2017-06-06 18:44:59.233664000 +0200
+++ ../syn/lib/ssl_openssl_lib.pas	2019-01-01 18:44:11.300125710 +0100
@@ -1,9 +1,9 @@
 {==============================================================================|
-| Project : Ararat Synapse                                       | 003.008.000 |
+| Project : Ararat Synapse                                       | 003.007.000 |
 |==============================================================================|
 | Content: SSL support by OpenSSL                                              |
 |==============================================================================|
-| Copyright (c)1999-2017, Lukas Gebauer                                        |
+| Copyright (c)1999-2012, Lukas Gebauer                                        |
 | All rights reserved.                                                         |
 |                                                                              |
 | Redistribution and use in source and binary forms, with or without           |
@@ -33,12 +33,11 @@
 | DAMAGE.                                                                      |
 |==============================================================================|
 | The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).|
-| Portions created by Lukas Gebauer are Copyright (c)2002-2017.                |
+| Portions created by Lukas Gebauer are Copyright (c)2002-2012.                |
 | Portions created by Petr Fejfar are Copyright (c)2011-2012.                  |
 | All Rights Reserved.                                                         |
 |==============================================================================|
 | Contributor(s):                                                              |
-|   Tomas Hajny (OS2 support)                                                  |
 |==============================================================================|
 | History: see HISTORY.HTM from distribution package                           |
 |          (Found at URL: http://www.ararat.cz/synapse/)                       |
@@ -88,13 +87,10 @@
   synafpc,
 {$IFNDEF MSWINDOWS}
   {$IFDEF FPC}
-   {$IFDEF UNIX}
-  BaseUnix,
-   {$ENDIF UNIX}
+  BaseUnix, SysUtils;
   {$ELSE}
-   Libc,
+   Libc, SysUtils;
   {$ENDIF}
-  SysUtils;
 {$ELSE}
   Windows;
 {$ENDIF}
@@ -116,18 +112,8 @@
     DLLSSLName: string = 'libssl.dylib';
     DLLUtilName: string = 'libcrypto.dylib';
     {$ELSE}
-     {$IFDEF OS2}
-      {$IFDEF OS2GCC}
-    DLLSSLName: string = 'kssl.dll';
-    DLLUtilName: string = 'kcrypto.dll';
-      {$ELSE OS2GCC}
-    DLLSSLName: string = 'ssl.dll';
-    DLLUtilName: string = 'crypto.dll';
-      {$ENDIF OS2GCC}
-     {$ELSE OS2}
     DLLSSLName: string = 'libssl.so';
     DLLUtilName: string = 'libcrypto.so';
-     {$ENDIF OS2}
     {$ENDIF}
   {$ELSE}
   DLLSSLName: string = 'ssleay32.dll';
@@ -232,6 +218,36 @@
   //The application is not happy
   X509_V_ERR_APPLICATION_VERIFICATION = 50;
 
+   V_ASN1_EOC                     = 0;
+   V_ASN1_BOOLEAN                 = 1;
+   V_ASN1_INTEGER                 = 2;
+   V_ASN1_BIT_STRING              = 3;
+   V_ASN1_OCTET_STRING            = 4;
+   V_ASN1_NULL                    = 5;
+   V_ASN1_OBJECT                  = 6;
+   V_ASN1_OBJECT_DESCRIPTOR       = 7;
+   V_ASN1_EXTERNAL                = 8;
+   V_ASN1_REAL                    = 9;
+   V_ASN1_ENUMERATED              = 10;
+   V_ASN1_UTF8STRING              = 12;
+   V_ASN1_SEQUENCE                = 16;
+   V_ASN1_SET                     = 17;
+   V_ASN1_NUMERICSTRING           = 18;
+   V_ASN1_PRINTABLESTRING         = 19;
+   V_ASN1_T61STRING               = 20;
+   V_ASN1_TELETEXSTRING           = 20;
+   V_ASN1_VIDEOTEXSTRING          = 21;
+   V_ASN1_IA5STRING               = 22;
+   V_ASN1_UTCTIME                 = 23;
+   V_ASN1_GENERALIZEDTIME         = 24;
+   V_ASN1_GRAPHICSTRING           = 25;
+   V_ASN1_ISO64STRING             = 26;
+   V_ASN1_VISIBLESTRING           = 26;
+   V_ASN1_GENERALSTRING           = 27;
+   V_ASN1_UNIVERSALSTRING         = 28;
+   V_ASN1_BMPSTRING               = 30;
+
+
   SSL_FILETYPE_ASN1	= 2;
   SSL_FILETYPE_PEM = 1;
   EVP_PKEY_RSA = 6;
@@ -298,26 +314,11 @@
 
   [DllImport(DLLSSLName, CharSet = CharSet.Ansi,
     SetLastError = False, CallingConvention= CallingConvention.cdecl,
-    EntryPoint = 'TLSv1_1_method')]
-    function SslMethodTLSV11:PSSL_METHOD;  external;
-
-  [DllImport(DLLSSLName, CharSet = CharSet.Ansi,
-    SetLastError = False, CallingConvention= CallingConvention.cdecl,
-    EntryPoint = 'TLSv1_2_method')]
-    function SslMethodTLSV12:PSSL_METHOD;  external;
-
-  [DllImport(DLLSSLName, CharSet = CharSet.Ansi,
-    SetLastError = False, CallingConvention= CallingConvention.cdecl,
     EntryPoint = 'SSLv23_method')]
     function SslMethodV23 : PSSL_METHOD; external;
 
   [DllImport(DLLSSLName, CharSet = CharSet.Ansi,
     SetLastError = False, CallingConvention= CallingConvention.cdecl,
-    EntryPoint = 'TLS_method')]
-    function SslMethodTLS : PSSL_METHOD; external;
-
-  [DllImport(DLLSSLName, CharSet = CharSet.Ansi,
-    SetLastError = False, CallingConvention= CallingConvention.cdecl,
     EntryPoint = 'SSL_CTX_use_PrivateKey')]
     function SslCtxUsePrivateKey(ctx: PSSL_CTX; pkey: SslPtr):Integer;  external;
 
@@ -721,12 +722,9 @@
   function SslMethodV2:PSSL_METHOD;
   function SslMethodV3:PSSL_METHOD;
   function SslMethodTLSV1:PSSL_METHOD;
-  function SslMethodTLSV11:PSSL_METHOD;
-  function SslMethodTLSV12:PSSL_METHOD;
   function SslMethodV23:PSSL_METHOD;
-  function SslMethodTLS:PSSL_METHOD;
   function SslCtxUsePrivateKey(ctx: PSSL_CTX; pkey: SslPtr):Integer;
-  function SslCtxUsePrivateKeyASN1(pk: integer; ctx: PSSL_CTX; d: AnsiString; len: integer):Integer;
+  function SslCtxUsePrivateKeyASN1(pk: integer; ctx: PSSL_CTX; d: ansistring; len: integer):Integer;
 //  function SslCtxUsePrivateKeyFile(ctx: PSSL_CTX; const _file: PChar; _type: Integer):Integer;
   function SslCtxUsePrivateKeyFile(ctx: PSSL_CTX; const _file: AnsiString; _type: Integer):Integer;
   function SslCtxUseCertificate(ctx: PSSL_CTX; x: SslPtr):Integer;
@@ -777,6 +775,8 @@
   function X509GmtimeAdj(s: PASN1_UTCTIME; adj: integer): PASN1_UTCTIME;
   function X509SetNotBefore(x: PX509; tm: PASN1_UTCTIME): integer;
   function X509SetNotAfter(x: PX509; tm: PASN1_UTCTIME): integer;
+  function X509GetNotBefore(x: PX509): PASN1_UTCTIME;
+  function X509GetNotAfter(x: PX509): PASN1_UTCTIME;
   function X509GetSerialNumber(x: PX509): PASN1_INTEGER;
   function EvpPkeyNew: EVP_PKEY;
   procedure EvpPkeyFree(pk: EVP_PKEY);
@@ -797,20 +797,25 @@
   procedure BioFreeAll(b: PBIO);
   function BioSMem: PBIO_METHOD;
   function BioCtrlPending(b: PBIO): integer;
-  function BioRead(b: PBIO; var Buf: AnsiString; Len: integer): integer;
+  function BioRead(b: PBIO; var buf: AnsiString; Len: integer): integer;
   function BioWrite(b: PBIO; Buf: AnsiString; Len: integer): integer;
   function d2iPKCS12bio(b:PBIO; Pkcs12: SslPtr): SslPtr;
   function PKCS12parse(p12: SslPtr; pass: Ansistring; var pkey, cert, ca: SslPtr): integer;
   procedure PKCS12free(p12: SslPtr);
   function RsaGenerateKey(bits, e: integer; callback: PFunction; cb_arg: SslPtr): PRSA;
   function Asn1UtctimeNew: PASN1_UTCTIME;
+  function Asn1StringTypeNew(aType : cint): PASN1_UTCTIME;
   procedure Asn1UtctimeFree(a: PASN1_UTCTIME);
+  Function Asn1UtctimePrint(b : PBio; a: PASN1_UTCTIME) : integer;
+  Function ASN1UtcTimeSetString(t : PASN1_UTCTIME; s : PAnsichar) : cint;
   function Asn1IntegerSet(a: PASN1_INTEGER; v: integer): integer;
   function Asn1IntegerGet(a: PASN1_INTEGER): integer; {pf}
   function i2dX509bio(b: PBIO; x: PX509): integer;
   function d2iX509bio(b:PBIO; x:PX509):  PX509;    {pf}
   function PEMReadBioX509(b:PBIO; {var x:PX509;}x:PSslPtr; callback:PFunction; cb_arg: SslPtr):  PX509;    {pf}
   procedure SkX509PopFree(st: PSTACK; func: TSkPopFreeFunc); {pf}
+  Procedure PEM_write_PrivateKey(i : cint; p1,P2,p3 : Pointer; i2 : Cint; p4,p5 : Pointer);
+  Procedure PEM_write_bio_X509( b  : PBIO; p : pointer);
 
 
   function i2dPrivateKeyBio(b: PBIO; pkey: EVP_PKEY): integer;
@@ -831,11 +836,7 @@
 
 implementation
 
-uses
-{$IFDEF OS2}
-  Sockets,
-{$ENDIF OS2}
-  SyncObjs;
+uses SyncObjs;
 
 {$IFNDEF CIL}
 type
@@ -850,10 +851,7 @@
   TSslMethodV2 = function:PSSL_METHOD; cdecl;
   TSslMethodV3 = function:PSSL_METHOD; cdecl;
   TSslMethodTLSV1 = function:PSSL_METHOD; cdecl;
-  TSslMethodTLSV11 = function:PSSL_METHOD; cdecl;
-  TSslMethodTLSV12 = function:PSSL_METHOD; cdecl;
   TSslMethodV23 = function:PSSL_METHOD; cdecl;
-  TSslMethodTLS = function:PSSL_METHOD; cdecl;
   TSslCtxUsePrivateKey = function(ctx: PSSL_CTX; pkey: sslptr):Integer; cdecl;
   TSslCtxUsePrivateKeyASN1 = function(pk: integer; ctx: PSSL_CTX; d: sslptr; len: integer):Integer; cdecl;
   TSslCtxUsePrivateKeyFile = function(ctx: PSSL_CTX; const _file: PAnsiChar; _type: Integer):Integer; cdecl;
@@ -903,6 +901,8 @@
   TX509GmtimeAdj = function(s: PASN1_UTCTIME; adj: integer): PASN1_UTCTIME; cdecl;
   TX509SetNotBefore = function(x: PX509; tm: PASN1_UTCTIME): integer; cdecl;
   TX509SetNotAfter = function(x: PX509; tm: PASN1_UTCTIME): integer; cdecl;
+  TX509GetNotBefore = function(x: PX509): PASN1_UTCTIME; cdecl;
+  TX509GetNotAfter = function(x: PX509) : PASN1_UTCTIME; cdecl;
   TX509GetSerialNumber = function(x: PX509): PASN1_INTEGER; cdecl;
   TEvpPkeyNew = function: EVP_PKEY; cdecl;
   TEvpPkeyFree = procedure(pk: EVP_PKEY); cdecl;
@@ -929,6 +929,9 @@
   TPKCS12free = procedure(p12: SslPtr); cdecl;
   TRsaGenerateKey = function(bits, e: integer; callback: PFunction; cb_arg: SslPtr): PRSA; cdecl;
   TAsn1UtctimeNew = function: PASN1_UTCTIME; cdecl;
+  TAsn1StringTypeNew = function(aype : cint): SSlPtr; cdecl;
+  TAsn1UtcTimeSetString = function(t : PASN1_UTCTIME; S : PAnsiChar): cint; cdecl;
+  TAsn1UtctimePrint = Function(b : PBio;a: PASN1_UTCTIME) : cint; cdecl;
   TAsn1UtctimeFree = procedure(a: PASN1_UTCTIME); cdecl;
   TAsn1IntegerSet = function(a: PASN1_INTEGER; v: integer): integer; cdecl;
   TAsn1IntegerGet = function(a: PASN1_INTEGER): integer; cdecl; {pf}
@@ -937,6 +940,8 @@
   TPEMReadBioX509 = function(b:PBIO;  {var x:PX509;}x:PSslPtr; callback:PFunction; cb_arg:SslPtr): PX509;   cdecl; {pf}
   TSkX509PopFree = procedure(st: PSTACK; func: TSkPopFreeFunc); cdecl; {pf}
   Ti2dPrivateKeyBio= function(b: PBIO; pkey: EVP_PKEY): integer; cdecl;
+  TPEM_write_PrivateKey = Procedure (i : cint; p1,P2,p3 : Pointer; i2 : Cint; p4,p5 : Pointer) ; cdecl;
+  TPEM_write_X509 = Procedure  ( i : PBio; p : pointer);cdecl;
 
   // 3DES functions
   TDESsetoddparity = procedure(Key: des_cblock); cdecl;
@@ -958,10 +963,7 @@
   _SslMethodV2: TSslMethodV2 = nil;
   _SslMethodV3: TSslMethodV3 = nil;
   _SslMethodTLSV1: TSslMethodTLSV1 = nil;
-  _SslMethodTLSV11: TSslMethodTLSV11 = nil;
-  _SslMethodTLSV12: TSslMethodTLSV12 = nil;
   _SslMethodV23: TSslMethodV23 = nil;
-  _SslMethodTLS: TSslMethodTLS = nil;
   _SslCtxUsePrivateKey: TSslCtxUsePrivateKey = nil;
   _SslCtxUsePrivateKeyASN1: TSslCtxUsePrivateKeyASN1 = nil;
   _SslCtxUsePrivateKeyFile: TSslCtxUsePrivateKeyFile = nil;
@@ -1008,6 +1010,8 @@
   _X509GmtimeAdj: TX509GmtimeAdj = nil;
   _X509SetNotBefore: TX509SetNotBefore = nil;
   _X509SetNotAfter: TX509SetNotAfter = nil;
+  _X509GetNotBefore: TX509GetNotBefore = nil;
+  _X509GetNotAfter: TX509GetNotAfter = nil;
   _X509GetSerialNumber: TX509GetSerialNumber = nil;
   _EvpPkeyNew: TEvpPkeyNew = nil;
   _EvpPkeyFree: TEvpPkeyFree = nil;
@@ -1034,6 +1038,9 @@
   _PKCS12free: TPKCS12free = nil;
   _RsaGenerateKey: TRsaGenerateKey = nil;
   _Asn1UtctimeNew: TAsn1UtctimeNew = nil;
+  _Asn1StringTypeNew: TAsn1StringTypeNew = nil;
+  _Asn1UtctimeSetString : TAsn1UtctimeSetString = Nil;
+  _Asn1UtctimePrint: TAsn1UtctimePrint = nil;
   _Asn1UtctimeFree: TAsn1UtctimeFree = nil;
   _Asn1IntegerSet: TAsn1IntegerSet = nil;
   _Asn1IntegerGet: TAsn1IntegerGet = nil; {pf}
@@ -1042,6 +1049,8 @@
   _PEMReadBioX509: TPEMReadBioX509 = nil; {pf}
   _SkX509PopFree: TSkX509PopFree = nil; {pf}
   _i2dPrivateKeyBio: Ti2dPrivateKeyBio = nil;
+  _PEM_write_PrivateKey :  TPEM_write_PrivateKey = Nil;
+  _PEM_write_X509 : TPEM_write_X509 = Nil;
 
   // 3DES functions
   _DESsetoddparity: TDESsetoddparity = nil;
@@ -1138,22 +1147,6 @@
     Result := nil;
 end;
 
-function SslMethodTLSV11:PSSL_METHOD;
-begin
-  if InitSSLInterface and Assigned(_SslMethodTLSV11) then
-    Result := _SslMethodTLSV11
-  else
-    Result := nil;
-end;
-
-function SslMethodTLSV12:PSSL_METHOD;
-begin
-  if InitSSLInterface and Assigned(_SslMethodTLSV12) then
-    Result := _SslMethodTLSV12
-  else
-    Result := nil;
-end;
-
 function SslMethodV23:PSSL_METHOD;
 begin
   if InitSSLInterface and Assigned(_SslMethodV23) then
@@ -1162,14 +1155,6 @@
     Result := nil;
 end;
 
-function SslMethodTLS:PSSL_METHOD;
-begin
-  if InitSSLInterface and Assigned(_SslMethodTLS) then
-    Result := _SslMethodTLS
-  else
-    Result := nil;
-end;
-
 function SslCtxUsePrivateKey(ctx: PSSL_CTX; pkey: SslPtr):Integer;
 begin
   if InitSSLInterface and Assigned(_SslCtxUsePrivateKey) then
@@ -1681,18 +1666,44 @@
 
 function Asn1UtctimeNew: PASN1_UTCTIME;
 begin
+  Result:=PASN1_UTCTIME(Asn1StringTypeNew());
   if InitSSLInterface and Assigned(_Asn1UtctimeNew) then
     Result := _Asn1UtctimeNew
   else
     Result := nil;
 end;
 
+function Asn1StringTypeNew(aType : cint): PASN1_UTCTIME;
+
+begin
+  if InitSSLInterface and Assigned(_Asn1StringTypeNew) then
+    Result := _Asn1StringTypeNew(aType)
+  else
+    Result := nil;
+end;
+
 procedure Asn1UtctimeFree(a: PASN1_UTCTIME);
 begin
   if InitSSLInterface and Assigned(_Asn1UtctimeFree) then
     _Asn1UtctimeFree(a);
 end;
 
+Function Asn1UtctimePrint(b : PBio; a: PASN1_UTCTIME) : Integer;
+begin
+  if InitSSLInterface and Assigned(_Asn1UtctimePrint) then
+    Result:=_Asn1UtctimePrint(b,a)
+  else
+    Result:=0;
+end;
+
+Function ASN1UtcTimeSetString(t: PASN1_UTCTIME; s : PAnsiChar) : Integer;
+begin
+  if InitSSLInterface and Assigned(_Asn1UtctimeSetString) then
+    Result:=_Asn1UtctimeSetString(t,s)
+  else
+    Result:=0;
+end;
+
 function X509GmtimeAdj(s: PASN1_UTCTIME; adj: integer): PASN1_UTCTIME;
 begin
   if InitSSLInterface and Assigned(_X509GmtimeAdj) then
@@ -1717,6 +1728,22 @@
     Result := 0;
 end;
 
+function X509GetNotBefore(x: PX509): PASN1_UTCTIME;
+begin
+  if InitSSLInterface and Assigned(_X509GetNotBefore) then
+    Result := _X509GetNotBefore(x)
+  else
+    Result := Nil;
+end;
+
+function X509GetNotAfter(x: PX509): PASN1_UTCTIME;
+begin
+  if InitSSLInterface and Assigned(_X509GetNotAfter) then
+    Result := _X509GetNotAfter(x)
+  else
+    Result := Nil;
+end;
+
 function i2dX509bio(b: PBIO; x: PX509): integer;
 begin
   if InitSSLInterface and Assigned(_i2dX509bio) then
@@ -1747,6 +1774,20 @@
     _SkX509PopFree(st,func);
 end;
 
+Procedure PEM_write_PrivateKey(i : cint; p1,P2,p3 : Pointer; i2 : Cint; p4,p5 : Pointer);
+
+begin
+  if InitSSLInterface and Assigned(_PEM_write_PrivateKey) then
+    _PEM_write_PrivateKey(i,p1,P2,p3,i2,p4,p5);
+end;
+
+Procedure PEM_write_bio_X509( b  : PBIO; p : pointer);
+
+begin
+  if InitSSLInterface and Assigned(_PEM_write_X509) then
+    _PEM_write_X509(b,p);
+end;
+
 function i2dPrivateKeyBio(b: PBIO; pkey: EVP_PKEY): integer;
 begin
   if InitSSLInterface and Assigned(_i2dPrivateKeyBio) then
@@ -1878,8 +1919,8 @@
       SSLLibHandle := 1;
       SSLUtilHandle := 1;
 {$ELSE}
-      SSLUtilHandle := LoadLib(DLLUtilName);
       SSLLibHandle := LoadLib(DLLSSLName);
+      SSLUtilHandle := LoadLib(DLLUtilName);
   {$IFDEF MSWINDOWS}
       if (SSLLibHandle = 0) then
         SSLLibHandle := LoadLib(DLLSSLName2);
@@ -1898,10 +1939,7 @@
         _SslMethodV2 := GetProcAddr(SSLLibHandle, 'SSLv2_method');
         _SslMethodV3 := GetProcAddr(SSLLibHandle, 'SSLv3_method');
         _SslMethodTLSV1 := GetProcAddr(SSLLibHandle, 'TLSv1_method');
-        _SslMethodTLSV11 := GetProcAddr(SSLLibHandle, 'TLSv1_1_method');
-        _SslMethodTLSV12 := GetProcAddr(SSLLibHandle, 'TLSv1_2_method');
         _SslMethodV23 := GetProcAddr(SSLLibHandle, 'SSLv23_method');
-        _SslMethodTLS := GetProcAddr(SSLLibHandle, 'TLS_method');
         _SslCtxUsePrivateKey := GetProcAddr(SSLLibHandle, 'SSL_CTX_use_PrivateKey');
         _SslCtxUsePrivateKeyASN1 := GetProcAddr(SSLLibHandle, 'SSL_CTX_use_PrivateKey_ASN1');
         //use SSL_CTX_use_RSAPrivateKey_file instead SSL_CTX_use_PrivateKey_file,
@@ -1950,6 +1988,8 @@
         _X509GmtimeAdj := GetProcAddr(SSLUtilHandle, 'X509_gmtime_adj');
         _X509SetNotBefore := GetProcAddr(SSLUtilHandle, 'X509_set_notBefore');
         _X509SetNotAfter := GetProcAddr(SSLUtilHandle, 'X509_set_notAfter');
+        _X509GetNotBefore := GetProcAddr(SSLUtilHandle, 'X509_get_notBefore');
+        _X509GetNotAfter := GetProcAddr(SSLUtilHandle, 'X509_get_notAfter');
         _X509GetSerialNumber := GetProcAddr(SSLUtilHandle, 'X509_get_serialNumber');
         _EvpPkeyNew := GetProcAddr(SSLUtilHandle, 'EVP_PKEY_new');
         _EvpPkeyFree := GetProcAddr(SSLUtilHandle, 'EVP_PKEY_free');
@@ -1976,6 +2016,9 @@
         _PKCS12free := GetProcAddr(SSLUtilHandle, 'PKCS12_free');
         _RsaGenerateKey := GetProcAddr(SSLUtilHandle, 'RSA_generate_key');
         _Asn1UtctimeNew := GetProcAddr(SSLUtilHandle, 'ASN1_UTCTIME_new');
+        _Asn1UtctimeSetString := GetProcAddr(SSLUtilHandle, 'ASN1_UTCTIME_set_string');
+        _Asn1StringTypeNew := GetProcAddr(SSLUtilHandle, 'ASN1_STRING_type_new');
+        _Asn1UtctimePrint := GetProcAddr(SSLUtilHandle, 'ASN1_UTCTIME_print');
         _Asn1UtctimeFree := GetProcAddr(SSLUtilHandle, 'ASN1_UTCTIME_free');
         _Asn1IntegerSet := GetProcAddr(SSLUtilHandle, 'ASN1_INTEGER_set');
         _Asn1IntegerGet := GetProcAddr(SSLUtilHandle, 'ASN1_INTEGER_get'); {pf}
@@ -1984,6 +2027,8 @@
         _PEMReadBioX509 := GetProcAddr(SSLUtilHandle, 'PEM_read_bio_X509'); {pf}
         _SkX509PopFree := GetProcAddr(SSLUtilHandle, 'SK_X509_POP_FREE'); {pf}
         _i2dPrivateKeyBio := GetProcAddr(SSLUtilHandle, 'i2d_PrivateKey_bio');
+        _PEM_write_PrivateKey :=  GetProcAddr(SSLUtilHandle, 'PEM_write_PrivateKey');
+        _PEM_write_X509 := GetProcAddr(SSLUtilHandle,'PEM_write_bio_X509');
 
         // 3DES functions
         _DESsetoddparity := GetProcAddr(SSLUtilHandle, 'DES_set_odd_parity');
@@ -2019,12 +2064,8 @@
         if assigned(_CRYPTOnumlocks) and assigned(_CRYPTOsetlockingcallback) then
           InitLocks;
 {$ENDIF}
-        SSLloaded := True;
-{$IFDEF OS2}
-        Result := InitEMXHandles;
-{$ELSE OS2}
         Result := True;
-{$ENDIF OS2}
+        SSLloaded := True;
       end
       else
       begin
@@ -2096,10 +2137,7 @@
     _SslMethodV2 := nil;
     _SslMethodV3 := nil;
     _SslMethodTLSV1 := nil;
-    _SslMethodTLSV11 := nil;
-    _SslMethodTLSV12 := nil;
     _SslMethodV23 := nil;
-    _SslMethodTLS := nil;
     _SslCtxUsePrivateKey := nil;
     _SslCtxUsePrivateKeyASN1 := nil;
     _SslCtxUsePrivateKeyFile := nil;
@@ -2178,6 +2216,8 @@
     _SkX509PopFree := nil; {pf}
     _i2dX509bio := nil;
     _i2dPrivateKeyBio := nil;
+    _PEM_write_PrivateKey :=  nil;
+    _PEM_write_X509 := Nil ;
 
     // 3DES functions
     _DESsetoddparity := nil;
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to