Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Linux by (6.1k points)

There is a pre-built OpenSSL library (libssl.a and libcrypto.a) available in my system forC++ application. I don't have any idea about the version of the OpenSSL library.

Can I get the version number from these pre-built libraries?

2 Answers

0 votes
by (11.7k points)

The version can be easily known in Linux, just read the below document:

and

You just have to use the functions listed down below:

SSLeay()

SSLeay_version()

The strings are mentioned in that document I gave the link above :

OpenSSL 0.9.5a 1 Apr 2000

OpenSSL 1.0.1e-fips 11 Feb 2013

Therefore, you can find this from the binary library using strings and grep:

strings libcrypto.so | grep "^OpenSSL \S\+ [0-9]\+ \S\+ [0-9]\+"

0 votes
by (1.9k points)

You can get the OpenSSL version number from the pre-built libraries 

Let’s have a look at the steps:

1. check through openssl command:

           if OpenSSL is installed, run the below command to check the version:

openssl version

2. Check in code:

    

   using the SSLeay() function in your C++ code:

 #include <openssl/opensslv.h>

#include <iostream>

int main(){

    std :: cout <<”OpenSSL version: “ <<OPENSSL_VERSION_TEXT << std::endl;

    return 0;

}

 This will retrieve the version embedded in the library

Related questions

0 votes
2 answers
0 votes
1 answer

1.4k questions

32.9k answers

507 comments

693 users

...