This Question is Not Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
39 Replies Last post: May 14, 2008 1:18 PM by exnihilo  
Click to view exnihilo's profile Bronze 20 posts since
Apr 10, 2008

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:
Click to view jadestorm's profile Jiver 2,546 posts since
Aug 10, 2005
Wow! +100 points for you! =) Great work!
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
Sweeeeeeeeeeeeeeeeet. I've set aside some time next week to look over patches and merge stuff into trunk/provide feedback where appropriate.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
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.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
Trunk would be best. I'm trying to spend as little time in 3.5.x work as possible. Thanks :D
Click to view emosbaugh's profile Bronze 9 posts since
Sep 20, 2007

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);

Click to view emosbaugh's profile Bronze 9 posts since
Sep 20, 2007
i get a truncation when i load a very large roster with the binary socket. this fixed the problem.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
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.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
Spiffy :D
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
Argh. Anything at our end that I could bug people to fix? I want to streamline this as much as possible.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
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.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
You should have permissions on JIRA now... if all went as intended.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
You should have access to http://www.igniterealtime.org/issues/browse/SW and http://www.igniterealtime.org/issues/browse/XIFF

Don't worry about versions at the moment. I still need to get that organized.
Click to view DavidSmith's profile Jiver 140 posts since
Jan 11, 2007
Seems to be the case :/
Click to view emosbaugh's profile Bronze 9 posts since
Sep 20, 2007

sorry to be that guy, but i think i found one more problem

line 207:

_incompleteRawXML += s;//concatenate the raw xml to the previous

should be:

_incompleteRawXML = s;

because when you pass in the concatenated strings, you are concatenating the new data twice

line 269

handleReceivedData(_incompleteRawXML + ev.data as String);

Click to view emosbaugh's profile Bronze 9 posts since
Sep 20, 2007

you are saying

_incompleteRawXML += s

but s = function param = _incompleteRawXML + ev.data as String

so now

_incompleteRawXML = _incompleteRawXML + _incompleteRawXML + ev.data as String

Click to view emosbaugh's profile Bronze 9 posts since
Sep 20, 2007