AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Workaround/Hack: OpenSSL 1.0.2g mit altem Indy
Thema durchsuchen
Ansicht
Themen-Optionen

Workaround/Hack: OpenSSL 1.0.2g mit altem Indy

Ein Thema von christophspaeth · begonnen am 16. Mär 2016
Antwort Antwort
christophspaeth

Registriert seit: 7. Mär 2008
73 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#1

Workaround/Hack: OpenSSL 1.0.2g mit altem Indy

  Alt 16. Mär 2016, 16:54
Hallo,
wie in http://www.delphipraxis.net/1332882-post49.html nachzulesen ist, funktionieren ältere Indy-Versionen nicht mit OpenSSL 1.0.1s / 1.0.2g.

Nachdem nicht zu jedem Zeitpunkt "mal eben" ein Wechsel der Indy-Version möglich ist, habe ich einen Hack geschrieben, der die Überprüfung "austrickst", aber eigentlich nur das fehlen von SSLv2_* kaschieren sollte.

Diese Unit muss lediglich in das Projekt aufgenommen werden. Für meinen Zweck funktioniert sie, wenn jemand Bedenken hat oder Gefahren sieht, freue ich mich über Feedback.

Die Logik befindet sich komplett im initialzation-Teil, es gibt also noch kein Exception-Handling.
Verwendung wie üblich auf eigene Gefahr.

Delphi-Quellcode:
unit IdOpenSSLHack_SSLv2;

interface
uses
  Classes,
  IdSSLOpenSSLHeaders;

implementation
var
  FFailedFunctionLoadList: TStringList;
  I: Integer;

initialization
  // hack to not fail with openSSL 1.0.2g (SSLv2 functions disabled)

  // first manually load the headers. his function will do the check for the
  // existance of the imported functions only once. So further (atomatic or manual)
  // calls e.g. via LoadOpenSSLLibrary or by creating an SSL Context get a true
  // from this call.
  IdSSLOpenSSLHeaders.Load();

  // now check that only the SSLv2_ functions are missing. Unload lib otherwise
  // to re-enable the check (not required when handle is 0)
  if IdSSLOpenSSLHeaders.GetCryptLibHandle <> 0 then
  begin
    FFailedFunctionLoadList := TStringList.Create();
    FFailedFunctionLoadList.CommaText := IdSSLOpenSSLHeaders.WhichFailedToLoad();
    // any functin startting with SSLv2_ may be missing, unload otherwise
    for I := 0 to FFailedFunctionLoadList.Count - 1 do
    begin
      if pos('SSLv2_', FFailedFunctionLoadList[I]) <> 1 then
      begin
        // unload again - we should get the "normal" check
        IdSSLOpenSSLHeaders.Unload();
        break;
      end;
    end;
    FFailedFunctionLoadList.Free;
  end;
end.
Christoph Späth
  Mit Zitat antworten Zitat
Antwort Antwort

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz