Problem logging in after checkingout and building last Smack revision

Hi all,

I have a **modified version of Spark **

which is running perfectly with a released version of Openfire.

Since I am not want to wait for the next release of Smack to have** Proxy Support**,

and i read this bug is fixed from revision 10705

(http://www.igniterealtime.org/issues/browse/SMACK-226),

I checked out this revision from SVN and built it with ant build.xml

without creating a new eclipse project or else.

I take the generated jar files: smack.jar, smackx.jar, smackx-debug.jar,

and replace them in my modified Spark and the login crashes with:

18-sep-2008 13:30:42 org.jivesoftware.spark.util.log.Log warning
ADVERTENCIA: Exception in Login:
SASL authentication failed:
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 327)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:438)
at org.jivesoftware.LoginDialog$LoginPanel$3.construct(LoginDialog.java:1509)
at org.jivesoftware.spark.util.SwingWorker$2.run(SwingWorker.java:131)
at java.lang.Thread.run(Thread.java:619)

Same JAR files just built, put on original Spark installation folder,

make Spark crash in loggin in the same way than in my modified Spark,

so it is not due to changes in my modified Spark or changes in server,

or accounts problems. It is something related to smack exclusively, i think.

Maybe some revisions from SVN are not good? How can i know it?

I made the same test with three full revisions: last, 10705 and 10427.

Some help or advise will be appreciated.

thanks in advance

regards,

dani

Hi all,

I found some clue: deactivating SASL Authentication, it works: my Spark connects and logins in Openfire.

ConnectionConfiguration config = new ConnectionConfiguration( “192.168.1.235”, 5222);

config.setSASLAuthenticationEnabled(false); // <-- NEW LINE

XMPPConnection connection = new XMPPConnection( config );

I was able to connect a non-encrypted-channel server.

My new question is:** how can i set a encrypted channel without using SASL Authentication?**

Despite of that, it was a partial success, becausewhat i need is having Proxy Support for my modified Spark.

And** i am using now a Smack with proxy support, but not a Spark with proxy use.**

Now I have my Spark (revision 10959) modified, and Smack revision 10674 (with proxy support)

replacing old Smack revision 10407 (last Smack version included in Spark SVN).

From here, add proxy support was easier: in** LoginDialog.java**,

just add some lines to get Proxy Config values from preferences,

create a ProxyInfo object (new in Smack, packet: org.jivesoftware.smack.proxy.*)

and get its SocketFactory to set to ConnectionConfiguration in this way:

if ( localPref.isProxyEnabled() ){

 // check proxyhost, proxyport, username, ...

 ProxyInfo proxyInfo = null;

 if ( protocol.equals("HTTP") )

      proxyInfo = new ProxyInfo( ProxyInfo.ProxyType.HTTP, host, port, ... );

 else

      proxyInfo = new ProxyInfo( ProxyInfo.ProxyType.SOCKS4, host, port, ... );

 config.setSocketFactory( proxyInfo.getSocketFactory() );

}

XMPPConnection connection = new XMPPConnection( config );

Maybe this code can help someone, while waiting for a Spark with updated Smack

which included proxy support.

Hi danipellex,

I think you are talking about separate things. SASL authentication is just for authentication, not for encryption.

Channel encryption for XMPP connections takes place before SASL authentication.

There are two flavors of encryption:

  • ‘Old-style’ SSL encrytion, which establishes a SSL connection on port 5223

  • Using ‘StartTls’ with the usual TCP connection on port 5222. This is the standard way.

But, BOSH specifitacion recomends using the first for HTTP.

Hope this will be helpful.

See you!

Rafael.

Hi, Rafis

you are absolutely right,

I mixed the terms,

but that is the greatest approximation

I have found to achieve my goal:

**Update Smack to my modified Spark, **

to have Proxy Support,

and run them all toguether.

While doing other things,

I continue working in it,

but i really thank you for your correction.

regards,

dani