ldap_sasl_bind_s works under Linux but not under WindowsHow can I profile C++ code running on Linux?How to detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor?How to bind to AD server in PHP with credentials from trusted domain?C++ compiling on Windows and Linux: ifdef switchLDAP Authentication, ldap_sasl_bind_s not working but ldap_simple_bind_s worksWhy can't my program compile under Windows 7 in French?Mex works under Linux but not under WindowsMumble/Google protobufs client side read data function errorPostgresql - LDAP Authentication against Active Directory (AD) - trouble from linux server while ok from windows serverglDrawElements works under Linux but not under Windows

Case Condition for two lines

How would you translate this? バタコチーズライス

Possible to ground-fault protect both legs of a MWBC with two single-pole breakers?

Is it okay for a ticket seller to grab a tip in the USA?

Scam? Phone call from "Department of Social Security" asking me to call back

What would it take to get a message to another star?

Why did Saruman lie?

Is it possible to grow new organs through exposure to radioactivity?

Why is there a large performance impact when looping over an array over 240 elements?

Clarification on Integrability

Is there any way to stop a user from creating executables and running them?

Running code generated in realtime in JavaScript with eval()

If I animate and control a zombie, does it benefit from Undead Fortitude when it's reduced to 0 HP?

Do I have to cite common CS algorithms?

What is the hottest thing in the universe?

If you know the location of an invisible creature, can you attack it?

How can God warn people of the upcoming rapture without disrupting society?

How can I communicate my issues with a potential date's pushy behavior?

Do Reform Jews believe in a theistic God?

Why are Tucker and Malcolm not dead?

Is there a SQL/English like language that lets you define formulations given some data?

Do beef farmed pastures net remove carbon emissions?

Should I email my professor about a recommendation letter if he has offered me a job?

Does Nightpack Ambusher's second ability trigger if I cast spells during the end step?



ldap_sasl_bind_s works under Linux but not under Windows


How can I profile C++ code running on Linux?How to detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor?How to bind to AD server in PHP with credentials from trusted domain?C++ compiling on Windows and Linux: ifdef switchLDAP Authentication, ldap_sasl_bind_s not working but ldap_simple_bind_s worksWhy can't my program compile under Windows 7 in French?Mex works under Linux but not under WindowsMumble/Google protobufs client side read data function errorPostgresql - LDAP Authentication against Active Directory (AD) - trouble from linux server while ok from windows serverglDrawElements works under Linux but not under Windows






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am currently trying to link to an LDAP server with the windows API (Winldap.h). When I use the Linux header (ldap.h), the bind works properly and I can do my research next. Under windows, impossible to bind, I always have the error "(81) Server out of service". Yet the parameters are the same!



Here is the code under Linux:



#include <ldap.h>

LDAP* ldapHandler;
ldap_initialize( &ldapHandler, "ldap://IP_SERVER");

int version( LDAP_VERSION3 );
ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

berval* serverCreds;
berval mycreds;
mycreds.bv_val = "myPwd";
mycreds.bv_len = sizeof("myPwd");

int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", LDAP_SASL_AUTOMATIC, &mycreds, nullptr, nullptr, &serverCreds);
if(res != LDAP_SUCCESS)
std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;
else
std::cout << "Bind success !" << std::endl;



Bind success is displayed. Now under Win32:



#include <winldap.h>

LDAP* ldapHandler;
ldapHandler = ldap_init("ldap://IP_SERVER", LDAP_PORT);

int version(LDAP_VERSION3);
ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

berval* serverCreds;
berval mycreds;
mycreds.bv_val = "myPwd";
mycreds.bv_len = sizeof("myPwd");

int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", "DIGEST-MD5", &mycreds, nullptr, nullptr, &serverCreds);
if (res != LDAP_SUCCESS)
std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;

else
std::cout << "Bind success !" << std::endl;



Can someone help me because the identifiers and the server are exactly the same in both codes ... the only difference that could play is on the authentication method where under Linux the macro LDAP_SASL_AUTOMATIC handles all alone . On Windows, I specify "DIGEST-MD5". But my LDAP server handles it well:



ldapsearch -h IP_SERVER -p 389 -x -b "" -s base -LLL supportedSASLMechanisms

supportedSASLMechanisms: GSSAPI
supportedSASLMechanisms: GSS-SPNEGO
supportedSASLMechanisms: EXTERNAL
supportedSASLMechanisms: DIGEST-MD5


Thanks










share|improve this question






























    0















    I am currently trying to link to an LDAP server with the windows API (Winldap.h). When I use the Linux header (ldap.h), the bind works properly and I can do my research next. Under windows, impossible to bind, I always have the error "(81) Server out of service". Yet the parameters are the same!



    Here is the code under Linux:



    #include <ldap.h>

    LDAP* ldapHandler;
    ldap_initialize( &ldapHandler, "ldap://IP_SERVER");

    int version( LDAP_VERSION3 );
    ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

    berval* serverCreds;
    berval mycreds;
    mycreds.bv_val = "myPwd";
    mycreds.bv_len = sizeof("myPwd");

    int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", LDAP_SASL_AUTOMATIC, &mycreds, nullptr, nullptr, &serverCreds);
    if(res != LDAP_SUCCESS)
    std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;
    else
    std::cout << "Bind success !" << std::endl;



    Bind success is displayed. Now under Win32:



    #include <winldap.h>

    LDAP* ldapHandler;
    ldapHandler = ldap_init("ldap://IP_SERVER", LDAP_PORT);

    int version(LDAP_VERSION3);
    ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

    berval* serverCreds;
    berval mycreds;
    mycreds.bv_val = "myPwd";
    mycreds.bv_len = sizeof("myPwd");

    int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", "DIGEST-MD5", &mycreds, nullptr, nullptr, &serverCreds);
    if (res != LDAP_SUCCESS)
    std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;

    else
    std::cout << "Bind success !" << std::endl;



    Can someone help me because the identifiers and the server are exactly the same in both codes ... the only difference that could play is on the authentication method where under Linux the macro LDAP_SASL_AUTOMATIC handles all alone . On Windows, I specify "DIGEST-MD5". But my LDAP server handles it well:



    ldapsearch -h IP_SERVER -p 389 -x -b "" -s base -LLL supportedSASLMechanisms

    supportedSASLMechanisms: GSSAPI
    supportedSASLMechanisms: GSS-SPNEGO
    supportedSASLMechanisms: EXTERNAL
    supportedSASLMechanisms: DIGEST-MD5


    Thanks










    share|improve this question


























      0












      0








      0








      I am currently trying to link to an LDAP server with the windows API (Winldap.h). When I use the Linux header (ldap.h), the bind works properly and I can do my research next. Under windows, impossible to bind, I always have the error "(81) Server out of service". Yet the parameters are the same!



      Here is the code under Linux:



      #include <ldap.h>

      LDAP* ldapHandler;
      ldap_initialize( &ldapHandler, "ldap://IP_SERVER");

      int version( LDAP_VERSION3 );
      ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

      berval* serverCreds;
      berval mycreds;
      mycreds.bv_val = "myPwd";
      mycreds.bv_len = sizeof("myPwd");

      int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", LDAP_SASL_AUTOMATIC, &mycreds, nullptr, nullptr, &serverCreds);
      if(res != LDAP_SUCCESS)
      std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;
      else
      std::cout << "Bind success !" << std::endl;



      Bind success is displayed. Now under Win32:



      #include <winldap.h>

      LDAP* ldapHandler;
      ldapHandler = ldap_init("ldap://IP_SERVER", LDAP_PORT);

      int version(LDAP_VERSION3);
      ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

      berval* serverCreds;
      berval mycreds;
      mycreds.bv_val = "myPwd";
      mycreds.bv_len = sizeof("myPwd");

      int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", "DIGEST-MD5", &mycreds, nullptr, nullptr, &serverCreds);
      if (res != LDAP_SUCCESS)
      std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;

      else
      std::cout << "Bind success !" << std::endl;



      Can someone help me because the identifiers and the server are exactly the same in both codes ... the only difference that could play is on the authentication method where under Linux the macro LDAP_SASL_AUTOMATIC handles all alone . On Windows, I specify "DIGEST-MD5". But my LDAP server handles it well:



      ldapsearch -h IP_SERVER -p 389 -x -b "" -s base -LLL supportedSASLMechanisms

      supportedSASLMechanisms: GSSAPI
      supportedSASLMechanisms: GSS-SPNEGO
      supportedSASLMechanisms: EXTERNAL
      supportedSASLMechanisms: DIGEST-MD5


      Thanks










      share|improve this question














      I am currently trying to link to an LDAP server with the windows API (Winldap.h). When I use the Linux header (ldap.h), the bind works properly and I can do my research next. Under windows, impossible to bind, I always have the error "(81) Server out of service". Yet the parameters are the same!



      Here is the code under Linux:



      #include <ldap.h>

      LDAP* ldapHandler;
      ldap_initialize( &ldapHandler, "ldap://IP_SERVER");

      int version( LDAP_VERSION3 );
      ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

      berval* serverCreds;
      berval mycreds;
      mycreds.bv_val = "myPwd";
      mycreds.bv_len = sizeof("myPwd");

      int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", LDAP_SASL_AUTOMATIC, &mycreds, nullptr, nullptr, &serverCreds);
      if(res != LDAP_SUCCESS)
      std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;
      else
      std::cout << "Bind success !" << std::endl;



      Bind success is displayed. Now under Win32:



      #include <winldap.h>

      LDAP* ldapHandler;
      ldapHandler = ldap_init("ldap://IP_SERVER", LDAP_PORT);

      int version(LDAP_VERSION3);
      ldap_set_option(ldapHandler, LDAP_OPT_PROTOCOL_VERSION, &version);

      berval* serverCreds;
      berval mycreds;
      mycreds.bv_val = "myPwd";
      mycreds.bv_len = sizeof("myPwd");

      int res = ldap_sasl_bind_s(ldapHandler, "cn=myuser,cn=users,dc=domain,dc=com", "DIGEST-MD5", &mycreds, nullptr, nullptr, &serverCreds);
      if (res != LDAP_SUCCESS)
      std::cout << "Bind fail with: " << ldap_err2string(res) << std::endl;

      else
      std::cout << "Bind success !" << std::endl;



      Can someone help me because the identifiers and the server are exactly the same in both codes ... the only difference that could play is on the authentication method where under Linux the macro LDAP_SASL_AUTOMATIC handles all alone . On Windows, I specify "DIGEST-MD5". But my LDAP server handles it well:



      ldapsearch -h IP_SERVER -p 389 -x -b "" -s base -LLL supportedSASLMechanisms

      supportedSASLMechanisms: GSSAPI
      supportedSASLMechanisms: GSS-SPNEGO
      supportedSASLMechanisms: EXTERNAL
      supportedSASLMechanisms: DIGEST-MD5


      Thanks







      c++ ldap






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 10:13









      AlgorysAlgorys

      87012 silver badges40 bronze badges




      87012 silver badges40 bronze badges

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374696%2fldap-sasl-bind-s-works-under-linux-but-not-under-windows%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374696%2fldap-sasl-bind-s-works-under-linux-but-not-under-windows%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴