title: MySQL 5.5 and SSL on Ubuntu 14.04
body: <p>I'm trying to set up a mysql server 5.5.38-0ubuntu0.14.04.1 with SSL support on an Ubuntu 14.04 Linux (64bit) with kernel 3.13.0-32-generic.</p>
  
  <p>I allowed remote access to mysql and changed the /etc/mysql/my.cnf in order to support ssl...</p>
  
  <pre><code>ssl=1
  ssl-ca=/etc/mysql/ca-cert.pem
  ssl-cert=/etc/mysql/server-cert.pem
  ssl-key=/etc/mysql/server-key.pem
  </code></pre>
  
  <p>I generated the certificates...</p>
  
  <pre><code>openssl genrsa 2048 &gt; ca-key.pem
  openssl req -new -x509 -nodes -days 3650 -key ca-key.pem &gt; ca-cert.pem
  
  openssl req -newkey rsa:2048 -days 3560 -nodes -keyout server-key.pem &gt; server-req.pem
  openssl rsa -in server-key.pem -out server-key.pem
  openssl x509 -req -in server-req.pem -days 3650 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 &gt; server-cert.pem
  
  openssl req -newkey rsa:2048 -days 3650 -nodes -keyout client-key.pem &gt; client-req.pem
  openssl rsa -in client-key.pem -out client-key.pem
  openssl x509 -req -in client-req.pem -days 3650 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 &gt; client-cert.pem
  </code></pre>
  
  <p>I have different names for the Common Name value used for the server and client certificates/keys. Same names seem to be a problem in some cases.</p>
  
  <p>I correctly set the permisions of all *.pem files (mysql:adm) which are in /etc/mysql/. After restaring mysql, I can login as root and see that ssl is now supported:</p>
  
  <pre><code>mysql&gt; show variables like '%ssl%';
  +---------------+-----------------------------------+
  | Variable_name | Value                             |
  +---------------+-----------------------------------+
  | have_openssl  | YES                               |
  | have_ssl      | YES                               |
  | ssl_ca        | /etc/mysql/ca-cert.pem     |
  | ssl_capath    |                                   |
  | ssl_cert      | /etc/mysql/server-cert.pem |
  | ssl_cipher    |                                   |
  | ssl_key       | /etc/mysql/server-key.pem  |
  +---------------+-----------------------------------+
  7 rows in set (0.00 sec)
  </code></pre>
  
  <p>So.. I generated a test-user to test a ssl connection:</p>
  
  <pre><code>mysql&gt; GRANT ALL PRIVILEGES ON *.* TO 'ssluser'@'localhost' IDENTIFIED BY 'password' REQUIRE X509;
  mysql&gt; flush privileges;
  </code></pre>
  
  <p>However, when I try to connect...</p>
  
  <pre><code># mysql -u ssluser -p --ssl-ca=ca-cert.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem
  Enter password:
  ERROR 2026 (HY000): SSL connection error: ASN: bad other signature confirmation
  </code></pre>
  
  <p>However, my certificates seem to be valid:</p>
  
  <pre><code># openssl verify -CAfile ca-cert.pem server-cert.pem client cert.pem
  server-cert.pem: OK
  client-cert.pem: OK
  </code></pre>
  
  <p>I tried to solve this problem since several hours, now I do not have any new ideas..
  Help is greatly appreciated!</p>