I've written code that under certain circumstances might load X509_STORE into SSL_CTX, and since I don't know if it happens I free the store at the end of the program.
I call X509_STORE_up_ref after loading the store into the context to avoid a reference count error, since SSL_CTX_free also frees the store in case it was loaded into the given context.
However, I noticed that X509_STORE_up_ref is a newer command and my program fails to compile on older systems. I'd like in that case to wrap the call to that function with an #ifdef for OpenSSL's version.
- What is the right way to check OpenSSL's version with an
#ifdef? - Am I right to even be in the position I'm in, or am I using the store the wrong way?