Upgrading PHP + OpenSSL
Overview
When upgrading the Veritrans module,
disabling SSL v3.0 / TLS 1.0 became mandatory within 2016.
This is a required step as part of a global security initiative, so
not only Veritrans but every other payment system (and non-payment systems too) must take the same countermeasures.
Google discloses the SSL 3.0 vulnerability “POODLE”; SSL 3.0 to be deprecated going forward
In the Veritrans payment module for EC-CUBE,
PHP uses the OpenSSL library to communicate with the payment service.
That PHP OpenSSL library needs to be upgraded to 1.0.1i or later (the latest version is recommended).
The ToDo items for this are as follows.
To use TLS 1.1 or later, you need OpenSSL 1.0.1i or later
→ Upgrade OpenSSL (1.0.1i or later)
→ Recompile PHP and upgrade the OpenSSL library (1.0.1i or later)
I have summarized how to handle the above.
- Note: The Apache configuration to disable SSL v3.0 / TLS 1.0 is covered separately.
A quick Google search will turn it up right away ♪
Environment
- CentOS release 6.6 (Final)
- PHP 5.3.9
- openssl 1.0.1g
Steps
Check the OpenSSL library version used by PHP
Since we are going to recompile PHP from here,
it is fine even if OpenSSL support is disabled.
- Note: This assumes a case where it is already installed.
1 | # php -i | grep OpenSSL |
We can confirm that the OpenSSL Library and Header Version used by PHP are 1.0.1g.
Back up the existing openssl
Since it is likely already installed,
we will set the current version aside for now.
1 | # openssl version |
Just in case something goes wrong, I took a backup so I can roll back.
Upgrade openssl
Build it from source.
1 | # cd /usr/local/src |
-fPIC is needed so that mod_ssl can be built as a dynamic shared object (DSO)
and hooked into and used from the PHP binary executable,
I would say.
Verify the openssl upgrade
I confirmed that the upgrade was applied correctly.
1 | # openssl version |
Recompile PHP
- Check how the existing PHP was configured
1 | # php -i | grep config |
If --with-openssl is missing, add it as shown above.
In this case it is already specified.
Using the configure information above,
after confirming that --with-openssl is present,
recompile.
- Recompile
1 | # cd /usr/local/src/php-5.3.9 |
If you get an error like the following, please review the “Upgrade openssl” step.
This is the kind of error that appears when you have freshly compiled and built openssl from source.
1 | configure: error: Cannot find OpenSSL's <evp.h> |
Check the OpenSSL library version used by PHP
1 | # php -i | grep OpenSSL |
Both the OpenSSL Library and Header Version are now as specified.
That’s all.

