tags:

views:

3823

answers:

4

(I've asked the same question of the jmeter-user mailing list, but I wanted to try here as well - so at the least I can update this with the answer once I find it).

I'm having trouble using JMeter to test a Tomcat webapp using a self-signed SSL cert. JMeter throws a SocketException with message Unconnected sockets not implemented. According to JMeter's docs, the application is designed and written to accept any certificate, self-signed or CA signed or whatever.

Has anyone run into this specific exception before?

I've attempted to export this certificate from the server and import it into my local keystore (with keytool -import -alias tomcat -file ), but the result is the same.

I've also tried setting javax.net.debug=all as a JVM arg (the JSSE reference guide lists this as a debugging step); however, I don't see any debugging output anywhere - should I expect this somewhere other than standard out/error?

+2  A: 

This is a hint rather than a proper answer: A cursory glance at Google results seems to suggest that the exception is usually caused by the code forcing the use of a default SSL socket factory that on purpose throws the exception when createSocket() is invoked on it. What some of the results seem to suggest is that the issue sometimes happens due to a bug in certain version in Java 6, or when the incorrect path or password is provided to the keystore.

So, I'd say, try using Java 5. Also, try pointing JMeter to a well-known site that uses proper SSL certificates. This way you could test the self-signed certificate hypothesis.

Alexander
Can you post some of the links, especially the ones about bugs in certain versions of Java 6?
matt b
1.6-related:http://www.nabble.com/CXF-and-Java-6-Update-10-td19463818.html https://www.willuhn.de/bugzilla/show_bug.cgi?id=628 https://bugzilla.kapott.org/show_bug.cgi?id=72the rest: try Googling :)
Alexander
A: 

I had Web Service problems similar to this with jdk 1.6.0_10.

I upgraded to 1.6.0_16 and everything worked.

ScArcher2
A: 

Try searching your classpath (in Eclipse, I do ctrl-shift-t to do this) for SSLSocketFactory*. If you find one, set it as a property on the Security class:

In my environment, I've found the following two:

Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");

or

Security.setProperty("ssl.SocketFactory.provider", "com.ibm.websphere.ssl.protocol.SSLSocketFactory");

(or for whatever other class you find)

Similarly for ServerSocketFactory, if you need server sockets.

Suppressingfire
A: 

The solution, that might help you if you want avoid all websphere configuration together:

Peter