2

I was wondering if there is a way to interrogate TLS/SSL connections in the way that OpenSSL's s_client can, and then return the results, so that I can manipulate it in java?

I have investigated javax.net.ssl, but I'm not sure that it gives me the flexibility to do what my app needs to do.

I have also looked at Bouncy Castle, with the same conclusion.

I have also successfully cross-compiled OpenSSL with the idea of statically linking it through the NDK. But while I have successfully cross-compiled it for ARM, I have found the NDK documentation... not amazing.

Is getting the functionality of s_client in java a fools errand, and I should instead focus on the OpenSSL route? Or am I trying to twist OpenSSL in ways it isn't meant?

Thanks!

Edit: To clarify, I'd like to get most of the basic functionality of s_client including being able to specify a cipher and see if I get a failed handshake, etc. The information that comes out of s_client isn't exactly structured, so I would even prefer something else if it could be manipulated easier.

2
  • "...I have found the NDK documentation... not amazing". +1 for that. See Chapters 8 and 9 of Android Native Development Kit Cookbook. I think you can find them online. Also see AOSP's JNI Tips.
    – jww
    Jul 3, 2014 at 14:50
  • "Is getting the functionality of s_client in java a fools errand..." - You should state exactly what you want that s_client provides. Java's SSL classes might offer what you want. Bruno and EJP have also have provided code to get some of the hidden values via reflection. Its hard to say though, without knowing what you want.
    – jww
    Jul 3, 2014 at 14:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.