Export to GitHub

asmack - issue #5

Can not get connection error when checking ssl certs etc


Posted on Mar 19, 2010 by Helpful Kangaroo

I'm trying the following code:

ConnectionConfiguration mXMPPConfig = new ConnectionConfiguration(mConfig.server, mConfig.port); mXMPPConfig.setExpiredCertificatesCheckEnabled(true); mXMPPConfig.setNotMatchingDomainCheckEnabled(true); mXMPPConfig.setSelfSignedCertificateEnabled(false);

mXMPPConnection = new XMPPConnection(mXMPPConfig); mXMPPConnection.connect();

This seems to work as I can see stacktraces in logcat saying that the cert does not match etc. The problem I'm having: I don't get an exception! So I thought I add an ConnectionListener. Because those are called when PacketReader calls its notifyConnectionError in case of an Exception.

Unfortunately I can't add that listener because the addConnectionListener method in Connection checks if it isConnected. Which obviously is not the case. From looking at the source code I can't see any other way to get that exception. Or am I missing something?

If not, is that isConnected check really necessary?

Comment #1

Posted on Mar 19, 2010 by Helpful Kangaroo

Also, even though the connect() method does not work, isConnected returns true! All tests were run with asmack as of 2010.03.03

Comment #2

Posted on Mar 21, 2010 by Grumpy Rhino

Could you please follow http://code.google.com/p/asmack/wiki/ReportingProblems to make the problem reproducable?

Could you at least point out a public server to reproduce the problem?

Regards, René

Comment #3

Posted on May 3, 2010 by Grumpy Rhino

No feedback for >4 weeks.

Status: Invalid

Labels:
Type-Defect Priority-Medium