Problem with timeout on ldaps connection.

Wiesław Bieniek <[email protected]>
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <[email protected]>
Hello,

I'm using ldaps protocol to communicate with LDAP Server

Handle = case eldap:open([LDAPHost], [{port, LDAPPort}, {timeout, 
Timeout}, {log, LogFun}, {ssl, true}, {sslopts, [{verify, verify_peer}, 
{reuse_sessions, false}, {cacertfile, CertFile}]}]) of
                  {ok, H} -> H;
                  Error -> ?DEBUG("Open Error: [~p]~n", [Error]),
                           error(Error)
              end,

When LDAP on LDAPHost:LDAPPort is not working and cannot respond for 
request this function hangs for about 3 minutes (although the Timeout is 
set to 1000 (1 sec.)) and then returns with {error, etimedout}.

I made some investigations and the root cause of this seems to be 
function from eldap:

do_connect(Host, Data, Opts) when Data#eldap.ldaps == false ->
     gen_tcp:connect(Host, Data#eldap.port, Opts, Data#eldap.timeout);
do_connect(Host, Data, Opts) when Data#eldap.ldaps == true ->
     ssl:connect(Host, Data#eldap.port, Opts++Data#eldap.tls_opts).

It does not use timeout when connecting using SSL.

I guess It need fixing is next release.

But there is an additional question:

Due to agreement with user we cannot change any part of OTP 
Distributions. Only official releases of OTP can be used.
Is it possible to workaround the problem without updating eldap.erl and 
recompiling OTP ?

-- 
*Wiesław Bieniek*
Projektant Telco BSS R&D

tel. +48 12 646 12 66
website: www.comarch.pl <http://www.comarch.pl>

_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs
smime.p7s (application/pkcs7-signature, 2.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.