[jdev] steps to complete tls negotiation

Chris Mullins chris.mullins at coversant.net
Wed Aug 9 16:48:58 CDT 2006


Your best bet by far is to go with an existing client library that will
allow you to focus on writing your client, rather than trying to figure
out the protocol details that have already been solved and neatly
wrapped up for your use.

 

There are a number of Java client libraries out there you can use, all
of which are listed at:

http://www.jabber.org/software/libraries.shtml

 

--

Chris Mullins

http://www.coversant.net/blogs/cmullins
<http://www.coversant.net/blogs/cmullins?utm_source=Email%2BDistribution
&utm_medium=email&utm_content=Email%2Bfrom%2BChris%2BMullins&utm_campaig
n=Organic> 

 

 

From: jdev-bounces at jabber.org [mailto:jdev-bounces at jabber.org] On Behalf
Of Hussam Shalaby
Sent: Wednesday, August 09, 2006 1:41 PM
To: Jabber software development list
Subject: Re: [jdev] steps to complete tls negotiation

 

Ali,

   I am a newbi to jabber and in the process to build my own client in
java, I spent a couple of days until I figured the TLS part, the code is
in java and I hope you can apply same to .net

 

 

//might need to build your trustAllCerts

   SSLContext sc = SSLContext.getInstance("SSL");
            sc.init(null, trustAllCerts, new
java.security.SecureRandom());

            System.out.println("*** Start
sslSocket............................");
            SSLSocketFactory sslFactory = sc.getSocketFactory();
            sslSocket = (SSLSocket) sslFactory.createSocket
(JABBER_SERVER_ADDRESS, JABBER_SERVER_SPORT);
            sslSocket.setSoTimeout(10000); //10 sec
            sslSocket.setKeepAlive(true);
            sslSocket.setUseClientMode(true);
            sslSocket.startHandshake ();
            System.out.println("// 2- --------------------
Completed\n\n\n");
// -----------------------------   TLS negotiation is ended.



 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20060809/66252924/attachment-0002.htm>


More information about the JDev mailing list