This article describes how to solve PDOException: SQLSTATE[HY000] [2002] Connection refused when connecting from any PHP application with PDO::MySQL to a SSL enabled MySQL database with mismatching CN.