Re: Client App and STARTLS auth

2011-06-16 Thread Rich Megginson
On 06/14/2011 09:40 AM, Massimiliano Pala wrote: Hello Rich, responses inline.. On 06/13/2011 10:30 AM, Rich Megginson wrote: [...] LDAPTLS_REQCERT=never ldapsearch -x -d 1 -ZZ -H ldap://yourhost:yourport -s base -b "" > output.log 2>&1 I executed the command.. and it worked. I attach the o

Re: Client App and STARTLS auth

2011-06-14 Thread Massimiliano Pala
Hello Rich, responses inline.. On 06/13/2011 10:30 AM, Rich Megginson wrote: [...] LDAPTLS_REQCERT=never ldapsearch -x -d 1 -ZZ -H ldap://yourhost:yourport -s base -b "" > output.log 2>&1 I executed the command.. and it worked. I attach the output. Any help on how can I duplicate this behavi

Re: Client App and STARTLS auth

2011-06-13 Thread Rich Megginson
On 06/10/2011 10:32 PM, Massimiliano Pala wrote: Hi Rich, to provide a better vision, I am trying to use openldap to connect to a server and ignoring errors in authentication of the certificates. I am working on a *client*. In particular the code I wrote is like this: ldap_initialize(&ld,

Re: Client App and STARTLS auth

2011-06-13 Thread Philip Guenther
On Fri, 10 Jun 2011, Massimiliano Pala wrote: > that's not really what I wanted.. I am developing my own ldap client and > I wanted to know what is the code path to set the option. > > I tried to use the following: > > ldap_set_option(ld, LDAP_OPT_X_TLS_REQUIRE_CERT, "never") > > but it always

Re: Client App and STARTLS auth

2011-06-13 Thread Rich Megginson
On 06/10/2011 02:11 PM, Massimiliano Pala wrote: Hi Rich, that's not really what I wanted.. I am developing my own ldap client and I wanted to know what is the code path to set the option. I tried to use the following: ldap_set_option(ld, LDAP_OPT_X_TLS_REQUIRE_CERT, "never") but it always fa

Re: Client App and STARTLS auth

2011-06-12 Thread Rich Megginson
On 06/10/2011 12:21 PM, Massimiliano Pala wrote: Hi all, are there examples on how to use STARTLS without requiring that the server's certificate is trusted ? If the crypto api used in the ldap library is OpenSSL, that is easy: - create a new ssl_ctx() with SSL_CTX_new() - set my function as th

Re: Client App and STARTLS auth

2011-06-10 Thread Massimiliano Pala
Hi Rich, to provide a better vision, I am trying to use openldap to connect to a server and ignoring errors in authentication of the certificates. I am working on a *client*. In particular the code I wrote is like this: ldap_initialize(&ld, url); if(crypto_api == LDAP_CRYPTO_API_OPENSSL)

Re: Client App and STARTLS auth

2011-06-10 Thread Massimiliano Pala
Hi Philip, all, thanks for the advice. I have changed the code.. and the option is set correctly. Question, do you think it is safe to do this as a fallback: if(ldap_set_option(ld, LDAP_OPT_X_TLS_REQUIRE_CERT, &level) != LDAP_OPT_SUCCESS) { if(ldap_set_option(NULL, LDAP_OPT

Re: Client App and STARTLS auth

2011-06-10 Thread Howard Chu
Massimiliano Pala wrote: Hi Rich, that's not really what I wanted.. I am developing my own ldap client and I wanted to know what is the code path to set the option. I tried to use the following: ldap_set_option(ld, LDAP_OPT_X_TLS_REQUIRE_CERT, "never") but it always fails ( != 0). Of course

Re: Client App and STARTLS auth

2011-06-10 Thread Massimiliano Pala
Hi Rich, that's not really what I wanted.. I am developing my own ldap client and I wanted to know what is the code path to set the option. I tried to use the following: ldap_set_option(ld, LDAP_OPT_X_TLS_REQUIRE_CERT, "never") but it always fails ( != 0). Also, I would like to know if there'

Client App and STARTLS auth

2011-06-10 Thread Massimiliano Pala
Hi all, are there examples on how to use STARTLS without requiring that the server's certificate is trusted ? If the crypto api used in the ldap library is OpenSSL, that is easy: - create a new ssl_ctx() with SSL_CTX_new() - set my function as the verify function with SSL_CTX_set_verify() - use