Is there any c code implementation for s_client -connect ??
Yes, there is.
Check in <openssl src>/apps/s_client.c
. That's the source code for the s_client
sub command. Or, visit OpenSSL's openssl/apps/s_client.c.
You can even build s_client
as stand alone with symbols so you can step it/debug it in-place. See How to run different 'modes' of a program based on command line parameters?
... EAP-TLS
As for the question on EAP-TLS... I don't think OpenSSL provides it. But I could be wrong.
I looked at the proposed standard a couple of years ago, and its more of a "framework" to plug-in authentication methods over a TLS (or into a TLS) channel. See RFC 5216 (TLS) and RFC 6347 (DTLS).
To use EAP-TLS, you need a "Keying Material Exporter". That's part of RFC 5705. I think the idea is to use your authentication method to produce the premaster_secret
or master_secret
, and then turn control back over to TLS.