Choi Choi - 1 year ago 71
C Question

Members of SSL structure

In a OpenSSL's SSL/TLS client implementation, a structure

is defined. For example here is usually the first few lines (from the link).

SSL_CTX* ctx = NULL;
BIO *web = NULL, *out = NULL;
SSL *ssl = NULL;


I have been unable to find its structure in the header files from the OpenSSL library. How can I learn the contents of
SSL * ssl

Answer Source

I have been unable to find its structure type in the header files from the openssl library.

It's unclear which version of openssl you are referring too and how did you look but a grep -r ' SSL;' /usr/include/openssl/ quickly turned up a match in openssl/ossl_typ.h for openssl 1.0.2:

   typedef struct ssl_st SSL;

A following grep for 'ssl_st' lead to its definition in openssl/ssl.h:


struct ssl_st
        /* protocol version
        int version;
        int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */

Note that location and content of the structure might differ in other versions of openssl.