YamingPeng100 / asmack

Automatically exported from code.google.com/p/asmack
Other
0 stars 0 forks source link

Can not get connection error when checking ssl certs etc #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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?

Original issue reported on code.google.com by felix.kn...@googlemail.com on 19 Mar 2010 at 10:50

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

Original comment by felix.kn...@googlemail.com on 19 Mar 2010 at 11:24

GoogleCodeExporter commented 9 years ago
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é

Original comment by rtreffer@gmail.com on 21 Mar 2010 at 1:44

GoogleCodeExporter commented 9 years ago
No feedback for >4 weeks.

Original comment by rtreffer@gmail.com on 3 May 2010 at 9:14