diff -U 3 -dHrN -- a/skychart/component/synapse/source/lib/blcksock.pas b/skychart/component/synapse/source/lib/blcksock.pas
--- a/skychart/component/synapse/source/lib/blcksock.pas 2017-04-12 09:21:36.872249313 +0200
+++ b/skychart/component/synapse/source/lib/blcksock.pas 2017-04-12 09:21:58.686247010 +0200
@@ -240,7 +240,7 @@
{:Specify requested SSL/TLS version for secure connection.}
TSSLType = (
LT_all,
- LT_SSLv2,
+ LT_SSLv23,
LT_SSLv3,
LT_TLSv1,
LT_TLSv1_1,
diff -U 3 -dHrN -- a/skychart/component/synapse/source/lib/ssl_openssl_lib.pas b/skychart/component/synapse/source/lib/ssl_openssl_lib.pas
--- a/skychart/component/synapse/source/lib/ssl_openssl_lib.pas 2017-03-05 10:27:48.000000000 +0100
+++ b/skychart/component/synapse/source/lib/ssl_openssl_lib.pas 2017-04-12 09:16:06.067282537 +0200
@@ -125,8 +125,8 @@
DLLUtilName: string = 'crypto.dll';
{$ENDIF OS2GCC}
{$ELSE OS2}
- DLLSSLName: string = 'libssl.so';
- DLLUtilName: string = 'libcrypto.so';
+ DLLSSLName: string = 'libssl.so.1.1';
+ DLLUtilName: string = 'libcrypto.so.1.1';
{$ENDIF OS2}
{$ENDIF}
{$ELSE}
@@ -283,11 +283,6 @@
[DllImport(DLLSSLName, CharSet = CharSet.Ansi,
SetLastError = False, CallingConvention= CallingConvention.cdecl,
- EntryPoint = 'SSLv2_method')]
- function SslMethodV2 : PSSL_METHOD; external;
-
- [DllImport(DLLSSLName, CharSet = CharSet.Ansi,
- SetLastError = False, CallingConvention= CallingConvention.cdecl,
EntryPoint = 'SSLv3_method')]
function SslMethodV3 : PSSL_METHOD; external;
@@ -313,6 +308,11 @@
[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;
@@ -713,12 +713,12 @@
function SslCtxNew(meth: PSSL_METHOD):PSSL_CTX;
procedure SslCtxFree(arg0: PSSL_CTX);
function SslSetFd(s: PSSL; fd: Integer):Integer;
- 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 SslCtxUsePrivateKeyFile(ctx: PSSL_CTX; const _file: PChar; _type: Integer):Integer;
@@ -841,12 +841,12 @@
TSslCtxNew = function(meth: PSSL_METHOD):PSSL_CTX; cdecl;
TSslCtxFree = procedure(arg0: PSSL_CTX); cdecl;
TSslSetFd = function(s: PSSL; fd: Integer):Integer; cdecl;
- 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;
@@ -948,12 +948,12 @@
_SslCtxNew: TSslCtxNew = nil;
_SslCtxFree: TSslCtxFree = nil;
_SslSetFd: TSslSetFd = nil;
- _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;
@@ -1106,14 +1106,6 @@
Result := 0;
end;
-function SslMethodV2:PSSL_METHOD;
-begin
- if InitSSLInterface and Assigned(_SslMethodV2) then
- Result := _SslMethodV2
- else
- Result := nil;
-end;
-
function SslMethodV3:PSSL_METHOD;
begin
if InitSSLInterface and Assigned(_SslMethodV3) then
@@ -1154,6 +1146,14 @@
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
@@ -1901,12 +1901,12 @@
_SslCtxNew := GetProcAddr(SSLLibHandle, 'SSL_CTX_new');
_SslCtxFree := GetProcAddr(SSLLibHandle, 'SSL_CTX_free');
_SslSetFd := GetProcAddr(SSLLibHandle, 'SSL_set_fd');
- _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,
@@ -2098,12 +2098,12 @@
_SslCtxNew := nil;
_SslCtxFree := nil;
_SslSetFd := nil;
- _SslMethodV2 := nil;
_SslMethodV3 := nil;
_SslMethodTLSV1 := nil;
_SslMethodTLSV11 := nil;
_SslMethodTLSV12 := nil;
_SslMethodV23 := nil;
+ _SslMethodTLS := nil;
_SslCtxUsePrivateKey := nil;
_SslCtxUsePrivateKeyASN1 := nil;
_SslCtxUsePrivateKeyFile := nil;
diff -U 3 -dHrN -- a/skychart/component/synapse/source/lib/ssl_openssl.pas b/skychart/component/synapse/source/lib/ssl_openssl.pas
--- a/skychart/component/synapse/source/lib/ssl_openssl.pas 2015-07-31 10:48:21.000000000 +0200
+++ b/skychart/component/synapse/source/lib/ssl_openssl.pas 2017-04-12 09:07:20.000000000 +0200
@@ -420,8 +420,8 @@
FLastError := 0;
Fctx := nil;
case FSSLType of
- LT_SSLv2:
- Fctx := SslCtxNew(SslMethodV2);
+ LT_SSLv23:
+ Fctx := SslCtxNew(SslMethodV23);
LT_SSLv3:
Fctx := SslCtxNew(SslMethodV3);
LT_TLSv1:
@@ -431,7 +431,7 @@
LT_TLSv1_2:
Fctx := SslCtxNew(SslMethodTLSV12);
LT_all:
- Fctx := SslCtxNew(SslMethodV23);
+ Fctx := SslCtxNew(SslMethodTLS);
else
Exit;
end;