title: Connect to remote MySQL server with SSL from PHP
body: <p>I'm trying to connect to remote MySQL server with SSL from PHP using mysql_connect:</p>
  
  <pre><code>$link = mysql_connect(
      "ip",
      "user",
      "pass",
      true,
      MYSQL_CLIENT_SSL
  )
  </code></pre>
  
  <p>And get worst error ever:</p>
  
  <pre><code>SSL connection error
  </code></pre>
  
  <p>I've added following params into my.cnf:</p>
  
  <pre><code>[client]
  ssl-ca      =/etc/mysql/ssl/ca-cert.pm
  ssl-cert    =/etc/mysql/ssl/client-cert.pem
  ssl-key     =/etc/mysql/ssl/client-key.pem
  </code></pre>
  
  <p>So I can connect to remote mysql successfully from terminal just using </p>
  
  <pre><code>#mysql -h ip -u user -p
  </code></pre>
  
  <p>So connection to mysql server do work and as far as I understand problem is in php/mysql cooperation. Probably I'm missing some params.</p>
  
  <p>Unfortunately I can't use mysqli lib because have too many working adapters for pdo_mysql.</p>
  
  <p>My PHP Version is 5.3.6-13ubuntu3.6
  MySQL version is 5.1.61</p>
  
  <p>Also I've added </p>
  
  <pre><code>mssql.secure_connection = On
  </code></pre>
  
  <p>to my php.ini</p>
  
  <p>Help will be appreciated!</p>