Re: [xSocket-develop] SSLContext in spring
Status: Inactive
Brought to you by:
grro
|
From: Gregor R. <gre...@go...> - 2008-08-05 04:16:40
|
Hi Nicolas, you can write your on SSLContext factory. For example see the SSLTestContextFactory (http://xsocket.svn.sourceforge.net/viewvc/xsocket/xsocket/http/trunk/src/test/java/org/xsocket/connection/http/SSLTestContextFactory.java?view=markup<http://xsocket.svn.sourceforge.net/viewvc/xsocket/xsocket/http/trunk/src/test/java/org/xsocket/connection/http/SSLTestContextFactory.java?view=markup>), which is used by the test classes of xSocket. cheers Gregor 2008/8/4 Nicolas Chalon <n.c...@gm...> > Hi Gregor, > > Thank you very much but unfortunately, I should have told you that as I am > on macosx 10.4 i am restricted to JAVA 5 and that I don't have any > getDefault method. Do you have any ideas ? > > Thanks in advance > > Nicolas > > > On Mon, Aug 4, 2008 at 7:00 PM, Gregor Roth <gre...@go...>wrote: > >> Hi Nicolas, >> to run the server in SSL mode is quite simple. Just use another >> constructor. Please see the example. >> >> <?xml version="1.0" encoding="UTF-8"?> >> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=" >> http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" >> http://www.springframework.org/schema/beans >> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> >> >> <bean id="server" class="org.xsocket.connection.http.server.HttpServer" >> init-method="start" destroy-method="close" scope="singleton"> >> <constructor-arg type="int" value="0"/> >> <constructor-arg type="org.xsocket.connection.http.IHttpHandler" >> ref="handler"/> >> <constructor-arg type="javax.net.ssl.SSLContext" ref="sslContext"/> >> <constructor-arg type="boolean" value="true"/> >> </bean> >> >> <bean id="sslContext" class="javax.net.ssl.SSLContext" >> factory-method="getDefault"/> >> >> <bean id="handler" class="myHandler " scope="prototype"/> >> >> </beans> >> >> In the example the default SSLContext (Java 1.6 feature) is used. >> >> Gregor >> >> >> >> >> 2008/8/4 Nicolas Chalon <n.c...@gm...> >> >>> Hi, >>> >>> First, I would like to thank you for this library that answers all my >>> needs in a nice,easy and well designed way. >>> Now, that said, I have a server configured in spring's >>> application-context as described in your documentation. That's working >>> perfectly, but now i would like to be able to use the SSL functionnalities. >>> Is it possible (and do you have any example) to configure the server to >>> use SSL only using beans defined in applicationContext ? >>> >>> Regards >>> >>> Nicolas >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the >>> world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> xSocket-develop mailing list >>> xSo...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsocket-develop >>> >>> >> > > > -- > Nicolas CHALON > n.c...@gm... > |