Note that there are some explanatory texts on larger screens.

plurals
  1. POBinding to ldap server with "ldaps"
    primarykey
    data
    text
    <p>I am writing a program that will connect to LDAP server running on port 10389. I am able to successfully bind to the server with the user dn and password. </p> <p>Here’s my sample program:</p> <pre><code>#include "windows.h" #include "winldap.h" #include "stdio.h" int main(int argc, char* argv[]) { LDAP* pLdapConnection = NULL; ULONG version = LDAP_VERSION3; ULONG connectSuccess = 0; INT returnCode = 0; pLdapConnection = ldap_init("localhost", 10389); if (pLdapConnection == NULL) { printf( "ldap_init failed"); goto error_exit; } else printf("ldap_init succeeded \n"); // Set the version to 3.0 (default is 2.0). returnCode = ldap_set_option(pLdapConnection, LDAP_OPT_PROTOCOL_VERSION, (void*)&amp;version); if(returnCode != LDAP_SUCCESS) { printf("SetOption Error:%0X\n", returnCode); goto error_exit; } // Connect to the server. connectSuccess = ldap_connect(pLdapConnection, NULL); if(connectSuccess == LDAP_SUCCESS) printf("ldap_connect succeeded \n"); else { printf("ldap_connect failed with 0x%x.\n",connectSuccess); goto error_exit; } printf("Binding ...\n"); returnCode = ldap_bind_s(pLdapConnection, "dc=mojo,dc=com", "mojo", LDAP_AUTH_SIMPLE); if (returnCode == LDAP_SUCCESS) printf("The bind was successful"); else{ printf("ldap_bind_s failed with 0x%x.\n",returnCode); goto error_exit; } // Cleanup and exit. ldap_unbind(pLdapConnection); return 0; // On error cleanup and exit. error_exit: ldap_unbind(pLdapConnection); return -1; } </code></pre> <p>How do I connect via "<code>ldaps://</code>"? ldaps server is listening on port 10636. </p> <p><img src="https://i.stack.imgur.com/1KQzL.png" alt="enter image description here"></p> <p>What is needed for my program to connect to “ldaps” on port 10636?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload