Check if openssl call failed

fixes #6622