Installing 2 versions openssl simultaneously

I need to install 2 different versions of OpenSSL simultaneously. I am currently using Amazon EC2 with the Amazon 32-bit AMI, which currently runs OpenSSL 1.0.0a. I have an old piece of software that I need to run that requires OpenSSL.0.9.6. Unfortunately, from what I have learned, OpenSSL is not backwards-compatible so I will need to install both versions simultaneously. I have found an RPM that will work, however, I have no idea how to go about installing them simultaneously without breaking anything. Any information on this subject would be greatly appreciated.

Thanks


Solution 1:

You may download source from openssl.org archive and compile it from source, installing into separate directory.

./config --prefix=/old-openssl-version-x.x.x --openssldir=/old-openssl-version-x.x.x
make
make test
sudo make install

Then use specific version like this:

/old-openssl-version-x.x.x/bin/openssl do whatever you want

Solution 2:

My guess is that you're running a distribution that doesn't have sane policies about naming library packages relative to the soname of the object(s) contained within it, and which also has conniptions about installing multiple versions of the same package.

In this case, your only option is to unpack the package by hand (I believe rpm2cpio is the starting point on that particular crusade, unless there's an rpm option that does the trick) and place the relevant files in the correct location(s). If you're only after libssl and (as a result) libcrypto, this should be fairly straightforward -- you copy libssl.so.0.9.6 and libcrypto.so.0.9.6 into place, and ldd on the problematic binary should show happiness.

If you do need the whole OpenSSL suite of a particular version, you need to publically name and shame the vendor, for the good of the Internet, because that's just ridiculous.