This did not help in debugging the openssl <= 1.0.1c issue at all and makes the code more complex. Keep it simple.