title: Problems setting up SSL connections for MySQL on Ubuntu 14.04
body: <p>I've been banging my head for a few days on this and I'm really at the end of my rope...</p>
  
  <p>I'm trying to set up SSL connections on MySQL 5.7.10 running on ubuntu 14.04 and no matter what I do, the user required to use SSL is always rejected with access denied when trying to connect.</p>
  
  <p>I was able to set up SSL easily on Windows (our dev machines) but for the love of me cannot get it to work on Linux.</p>
  
  <p>I tried to use the certificates provided when installing MySQL (located in the /var/lib/mysql directory).  I also tried to generate new ones using <a href="https://oracle-base.com/articles/mysql/mysql-configure-ssl-connections" rel="nofollow">this procedure</a>.  I even tried to import the certificates that I generated using MySQL Workbench on Windows (the ones that actually worked on windows) but nothing works.</p>
  
  <p>When starting up MySQL, SSL seems to be okay, as I only get this in /var/log/mysql/err.log</p>
  
  <pre><code>2015-12-17T18:25:32.687582Z 0 [Warning] CA certificate /var/lib/mysql/ca.pem is self signed.
  </code></pre>
  
  <p>SSL is ON in MySQL</p>
  
  <pre><code>mysql&gt; SHOW VARIABLES LIKE '%SSL%';
  +---------------+--------------------------------+
  | Variable_name | Value                          |
  +---------------+--------------------------------+
  | have_openssl  | YES                            |
  | have_ssl      | YES                            |
  | ssl_ca        | /var/lib/mysql/ca.pem          |
  | ssl_capath    |                                |
  | ssl_cert      | /var/lib/mysql/server-cert.pem |
  | ssl_cipher    |                                |
  | ssl_crl       |                                |
  | ssl_crlpath   |                                |
  | ssl_key       | /var/lib/mysql/server-key.pem  |
  +---------------+--------------------------------+
  </code></pre>
  
  <p>I've put the paths to the server and client certificates in the /etc/mysql/my.cnf</p>
  
  <pre><code>[client]
  # SSL Settings
  ssl-ca=/var/lib/mysql/ca.pem
  ssl-cert=/var/lib/mysql/client-cert.pem
  ssl-key=/var/lib/mysql/client-key.pem
  
  [mysqld]
  # SSL Settings
  ssl-ca=/var/lib/mysql/ca.pem
  ssl-cert=/var/lib/mysql/server-cert.pem
  ssl-key=/var/lib/mysql/server-key.pem
  </code></pre>
  
  <p>I even tried to disabled appArmor for mysql in case that would do it, bot I alwas get the sema result when trying to connect a test user requiring ssl as such:</p>
  
  <pre><code>CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';
  GRANT USAGE ON *.* TO 'test'@'localhost' REQUIRE ssl;
  FLUSH PRIVILEGES;
  </code></pre>
  
  <p>When trying to connect:</p>
  
  <pre><code>&gt; /usr/bin$ mysql -u test -p
  Enter password:
  ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)
  </code></pre>
  
  <p>Same thing when manually specifying the client certificates:</p>
  
  <pre><code>&gt; mysql --ssl-ca=/var/lib/mysql/ca.pem --ssl-cert=/var/lib/mysql/client-cert.pem --ssl-key=/var/lib/mysql/client-key.pem --host=localhost --user=test --password
  Enter password:
  ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)
  </code></pre>
  
  <p>Does anybody have any idea?  I fail to see why a setuyp that works fine on windows would give me such grief on linux.</p>
  
  <p>Is there a way to debug this further?</p>
  
  <p>Thansk in advance
  /Sebas</p>