Getting Socket closed error when I try Connecting to iPlanet Directory server thru SSL
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pramod_Mirji
Posted On:   Tuesday, February 5, 2002 05:25 AM

Hi Friends, I am trying to connect to iPlanet Directory server 5.1 thru SSL. Using iPlanet Directory server I generated certificate request and used that request to get certificate from Verisign and installed it in the directory server. the I tried following code java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); Hashtable env = new Hashtable(11); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:636"); // Specify SSL env.put (Context.SECURITY_PROTOCOL, "ssl");    More>>

Hi Friends,

I am trying to connect to iPlanet Directory server 5.1 thru SSL.


Using iPlanet Directory server I generated certificate request and used that request to get certificate from Verisign and installed it in the directory server.


the I tried following code

			
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());


Hashtable env = new Hashtable(11);

env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");


env.put(Context.PROVIDER_URL, "ldap://localhost:636");

// Specify SSL

env.put (Context.SECURITY_PROTOCOL, "ssl");


// Authenticate as S. User and password "mysecret"

env.put(Context.SECURITY_AUTHENTICATION, "simple");

env.put(Context.SECURITY_PRINCIPAL, "uid=kvaughan, ou=People, dc=mipl,dc=com");

env.put(Context.SECURITY_CREDENTIALS, "bribery");

try {

// Create initial context

DirContext ctx = new InitialDirContext(env);

.....

.....



When I try to create context I am getting the following exception

			
javax.naming.CommunicationException: pramod:636. Root exception is java.net.SocketException: Socket
closed

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])

at com.sun.net.ssl.internal.ssl.AppOutputStream.write([DashoPro-V1.2-120198])

at java.io.OutputStream.write(OutputStream.java:65)

at com.sun.jndi.ldap.Connection. (Connection.java:214)

at com.sun.jndi.ldap.LdapClient. (LdapClient.java:113)

at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2384)

at com.sun.jndi.ldap.LdapCtx. (LdapCtx.java:244)

at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:79)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)

at javax.naming.InitialContext.init(InitialContext.java:226)

at javax.naming.InitialContext. (InitialContext.java:202)

at javax.naming.directory.InitialDirContext. (InitialDirContext.java:87)

at Ssl.main(Ssl.java:72)




can anyone help me with this

Thanks,
Pramod    <<Less
About | Sitemap | Contact