AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Umstellung LDAP auf SSL/TLS

Ein Thema von Blup · begonnen am 17. Mai 2024 · letzter Beitrag vom 21. Mai 2024
Antwort Antwort
Blup

Registriert seit: 7. Aug 2008
Ort: Brandenburg
1.487 Beiträge
 
Delphi 12 Athens
 
#1

Umstellung LDAP auf SSL/TLS

  Alt 17. Mai 2024, 13:19
Ich versuche eine vorhandene Anwendung von LDAP zu LDAPS umzustellen.

Derzeitiges Problem: Fehlermeldung bei der Abfrage der Option LDAP_OPT_SSL.
Als Ergebnis bekomme ich einen Code der mit ldap_err2string als "Parameterfehler" zurück gibt.
Delphi-Quellcode:
FConn: Pointer;
FSSL: Pointer;
FVersion: Integer;

  TriggerProtocol(Self, 'Initialize an LDAP session using SSL');
  fConn := ldap_sslinit(PChar(fHost), fPort, 1);

  try
    FVersion := LDAP_VERSION3;
    TriggerProtocol(Self, Format('Setting Protocol version to %d', [FVersion]));
    LDAPCheck(ldap_set_option(fConn, LDAP_OPT_PROTOCOL_VERSION, @FVersion));

    TriggerProtocol(Self, 'Checking if SSL is enabled');
    FSSL := LDAP_OPT_OFF;
    LDAPCheck(ldap_get_option(fConn, LDAP_OPT_SSL, FSSL));
    TriggerProtocol(Self, IfThen(FSSL = LDAP_OPT_ON, 'SSL is enabled', 'SSL not enabled'));

    if FSSL <> LDAP_OPT_ON then
    begin
      TriggerProtocol(Self, 'SSL being enabled...');
      FSSL := LDAP_OPT_ON;
      LDAPCheck(ldap_set_option(fConn, LDAP_OPT_SSL, FSSL));
    end;
Das Protokoll:
Code:
Initialize an LDAP session using SSL
Setting Protocol version to 3
Checking if SSL is enabled
Parameterfehler
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
387 Beiträge
 
#2

AW: Umstellung LDAP auf SSL/TLS

  Alt 17. Mai 2024, 13:45
Delphi-Quellcode:
    //LDAPCheck(ldap_get_option(fConn, LDAP_OPT_SSL, FSSL));
    LDAPCheck(ldap_get_option(fConn, LDAP_OPT_SSL, @FSSL)); ??
Also notice that FSSL and FVersion should be NativeUInt.
Kas
  Mit Zitat antworten Zitat
Blup

Registriert seit: 7. Aug 2008
Ort: Brandenburg
1.487 Beiträge
 
Delphi 12 Athens
 
#3

AW: Umstellung LDAP auf SSL/TLS

  Alt 17. Mai 2024, 14:04
@FSSL

Das gibt "Lokaler Fehler".
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
387 Beiträge
 
#4

AW: Umstellung LDAP auf SSL/TLS

  Alt 17. Mai 2024, 16:30
@FSSL

Das gibt "Lokaler Fehler".
At least it is not a parameter error any more, i would suggest to follow Microsoft example and find the missing step leading to this.

https://learn.microsoft.com/en-us/pr...ession-options
Kas
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
387 Beiträge
 
#5

AW: Umstellung LDAP auf SSL/TLS

  Alt 17. Mai 2024, 16:31
sorry !

this one is more direct:
https://learn.microsoft.com/en-us/pr...ssion-over-ssl
Kas
  Mit Zitat antworten Zitat
Blup

Registriert seit: 7. Aug 2008
Ort: Brandenburg
1.487 Beiträge
 
Delphi 12 Athens
 
#6

AW: Umstellung LDAP auf SSL/TLS

  Alt 17. Mai 2024, 17:22
Das ist das Beispiel das ich versuche nachzuprogrammieren.

Code:
//  Verify that SSL is enabled on the connection.
    //  (returns LDAP_OPT_ON/_OFF).
    printf("Checking if SSL is enabled\n");
    returnCode = ldap_get_option(pLdapConnection,LDAP_OPT_SSL,(void*)&amp;lv);
    if (returnCode != LDAP_SUCCESS)
        goto FatalExit;
Und genau an der Stelle komme ich jetzt nicht weiter.
  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 22:57 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz