[Date Prev][Date Next] [Chronological] [Thread] [Top]

SSLHandshakeException when try connect LDAP



Well, i`m newbie in LDAP with SLL.
My problem is, i connect in server LDAP from my web application and do the
authentication by LDAP with SSL. But in some( in time could 5 trying or 6
maybe less ) connections this exception appear:

javax.naming.CommunicationException: simple bind failed:
grudedev03.grude.ufmg.br:636.  Root exception is
javax.net.ssl.SSLHandshakeException: Remote host closed connection during
handshake
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
        at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
        at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
        at
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
        at com.sun.jndi.ldap.Connection.writeRequest(Connection.java:390)
        at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:334)
        at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:193)
        at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2597)
        at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:275)
        at
com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:173)
        at
com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:191)
        at
com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
        at
com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
        at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
        at javax.naming.InitialContext.init(InitialContext.java:219)
        at javax.naming.InitialContext.<init>(InitialContext.java:195)
        at
javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:80)
        at
br.ufmg.lcc.gdf.Autenticacao.Usuario.verificaAutenticidade(Usuario.java:121)
        at HttpControlador.doPost(HttpControlador.java:439)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:536)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
        at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA6275)
        ... 53 more
Usuario nao foi autenticado

The application do:
1 --> take de uid form user an password
2 --> make a search with a filter and base:
      String filter = "(uid=" + usuarioID + "*)" ;
      String base = "dc=ufmg,dc=br";
3 --> get the cannonical name(CN) and close the connection.
4 --> now, the SSL connection is create with CN user and the password.
5 --> and work`s fine.

But, how i told previous, the exception appears without frequency 5 or 7
times.
Some body, could help me.
Is this a version problem configuration or something else?

Sever running: Red Hat Linux 8.0
                   openldap-release 2.1.2
                   OpenSSL 0.9.6b [engine] 9 Jul 2001


Application use: JNDI API 1.2.1
___________________________________
Itamar Moreira Pinto Júnior
Graduando de Ciência da Computação
da PUC - Minas
LCC/UFMG - Cenapad
kbul@lcc.ufmg.br
kbul@cenapad.ufmg.br