[jdev] steps to complete tls negotiation

Hussam Shalaby hshalaby at gmail.com
Wed Aug 9 15:40:48 CDT 2006


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.




On 8/9/06, ali <marslan.ali at gmail.com> wrote:
>
> >Have you looked at RFC 3920?
>
> >http://www.xmpp.org/specs/rfc3920.html#tls
>
> >Peter
>
>
> Yes i have gone through Use of TLS section of RFE3920 and can't understand
> these two points how to implement them progrmatically i am programming in
> VB.Net
>
>        The initiating entity MUST validate the certificate presented by
>       the receiving entity
>
> i want to know the why to read the certificate presented by jabber.com
>
>
> Muhammad Arslan Ali
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20060809/1eb71fc8/attachment-0002.htm>


More information about the JDev mailing list