This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
42 Replies Last post: Sep 4, 2008 4:54 AM by alski  
Dustin Bronze 21 posts since
Apr 10, 2008
Currently Being Moderated

Apr 10, 2008 8:43 PM

Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

I have tested it multiple times against 3.4.1-3.4.4 versions of openfire.  I verified packet encryption using Wireshark.  I've tested this in both Flex and Air applications.   

 

Things you need...

 

 

  • AS3 version of XIFF

    • replace XMPPConnection with attached version

    • replace XMPPSocketConnection with attached version

  • Latest Crypto

    • add UTF8String to util/der

    • replace DER with attached (additional type support for openfire certs)

 

Things to note before hand. 

 

 

  • This only works with XMPPSocketConnection

  • I'm not sure but I think crypto will only work with RSA certs.  I could be wrong though.  Will be checking into it more later.

  • Crypto does not work with self signed certificates (detault certs generated by openfire).  This can be bipassed by commenting out the checks in TLSEngine.loadCertificates(certs:Array).  Just leave these two lines uncommented in the if block that checks for signed/unsigned.

 

trace("TLS WARNING: No check made on the certificate's identity.");

_otherCertificate = firstCert;

 

 

 

 

To use TLS simply use the following boolean flag on your interface scripting that handles the initial connect.  Here is my example code block. 

 

 

 

 

xconn.username = usernameti.text;

userAccount = usernameti.text;

xconn.password = passwordti.text;

 

xconn.server = DEFAULT_SERVER;

xconn.tls = true;

xconn.connect("standard");

 

 

 

 

 

 

 

 

Enjoy!  Let me know if you have any success.  Not all the kinks have been worked out but it's a good start.

Attachments:
Daniel Henninger Jiver 2,904 posts since
Aug 10, 2005
Currently Being Moderated
Apr 11, 2008 1:45 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

Wow!  +100 points for you!  =)  Great work!

David Smith KeyContributor 187 posts since
Jan 11, 2007
Currently Being Moderated
Apr 11, 2008 4:20 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

Sweeeeeeeeeeeeeeeeet. I've set aside some time next week to look over patches and merge stuff into trunk/provide feedback where appropriate.

David Smith KeyContributor 187 posts since
Jan 11, 2007
Currently Being Moderated
Apr 23, 2008 1:52 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

OK, having finally recovered from being sick last week, I'm taking a look at this now. An svn diff would have been nice for reviewing what's different.

 

Did you actually get XMPPSocketConnection working? It's been pretty finicky in my testing.

David Smith KeyContributor 187 posts since
Jan 11, 2007
Currently Being Moderated
Apr 23, 2008 5:37 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

Trunk would be best. I'm trying to spend as little time in 3.5.x work as possible. Thanks

Ethan Mosbaugh Bronze 9 posts since
Sep 20, 2007
Currently Being Moderated
May 2, 2008 2:35 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

 

i found one little bug i think. please correct me if im wrong:

 

 

line 115 of XMPPSocketConnection.as I think should be

 

 

handleReceivedData(_incompleteRawXML + s);

 

 

instead of

 

 

handleReceivedData(s); 

 

 

Ethan Mosbaugh Bronze 9 posts since
Sep 20, 2007
Currently Being Moderated
May 6, 2008 2:00 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

i get a truncation when i load a very large roster with the binary socket. this fixed the problem.

David Smith KeyContributor 187 posts since
Jan 11, 2007
Currently Being Moderated
May 7, 2008 12:07 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

OK, I'm looking over this right now. So far so good

 

Have you read http://www.igniterealtime.org/community/docs/DOC-1495 btw? I'd love to get this merged in if you're ok with the contributor agreement.

David Smith KeyContributor 187 posts since
Jan 11, 2007
Currently Being Moderated
May 8, 2008 3:02 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

Spiffy

David Smith KeyContributor 187 posts since
Jan 11, 2007
Currently Being Moderated
May 12, 2008 4:46 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

Argh. Anything at our end that I could bug people to fix? I want to streamline this as much as possible.

David Smith KeyContributor 187 posts since
Jan 11, 2007
Currently Being Moderated
May 13, 2008 3:03 PM in response to: Dustin
Re: Have Working Xiff3 + Crypto Solution for TLS -Enjoy : )

If you set up a JIRA account (http://www.igniterealtime.org/issues/) I can turn on write access for it, so you can file issues and attach patches. That's probably the best way to handle things for now.