title: MySql ssl connection with self signed certificate
body: <p>Hey I want to connect to mySql db using ssl secure connection. I did the following:</p>
  
  <p>Create self signed certificates (resource: <a href="https://dev.mysql.com/doc/refman/5.6/en/creating-ssl-files-using-openssl.html" rel="nofollow">https://dev.mysql.com/doc/refman/5.6/en/creating-ssl-files-using-openssl.html</a>):</p>
  
  <pre><code>#server
  openssl genrsa 2048 &gt; ca-key.pem
  
  openssl req -new -x509 -nodes -days 3600 -key ca-key.pem -out ca.pem
  
  openssl req -newkey rsa:2048 -days 3600 nodes -keyout server-key.pem -out server-req.pem
  
  openssl rsa -in server-key.pem -out server-key.pem
  
  openssl x509 -req -in server-req.pem -days 3600 -CA ca.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
  
  #client 
  
  openssl req -newkey rsa:2048 -days 3600 -nodes -keyout client-key.pem -out client-req.pem
  
  openssl rsa -in client-key.pem -out client-key.pem
  
  openssl x509 -req -in client-req.pem -days 3600 -CA ca.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem
  
  #signing
  
  openssl verify -CAfile ca.pem server-cert.pem client-cert.pem
  </code></pre>
  
  <p>Created the my.cnf  file in C:\Program Files\MySQL\MySQL Server X.Y (since it didn't exists) and added this lines (resource: <a href="https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-ssl.html" rel="nofollow">https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-ssl.html</a>) </p>
  
  <pre><code>ssl-ca=c:/certs/ca.pem 
  ssl-cert=c:/certs/server-cert.pem 
  ssl-key=c:/certs/server-key.pem 
  </code></pre>
  
  <p>Then connected to mysql using root and created the sslclient user :</p>
  
  <pre><code>CREATE USER 'sslclient'@'localhost';
  </code></pre>
  
  <p>Now when I'm trying to connect to mySql db using ssl : </p>
  
  <pre><code> mysql -h localhost -u sslclient -p --ssl=1 --ssl-cert=client-cert.pem --ssl-key=client-key.pem --ssl-ca=ca.cert 
  </code></pre>
  
  <p>I get the following exception: </p>
  
  <pre><code> SSL connection error: SSL is required but the server doesn't support it
  </code></pre>
  
  <p>I tried it also as the root user and also tried to change the ssl settings through MySQl Workbench > right click on my connection > edit connection > connection> ssl and filled the relevant fields. </p>
  
  <p>EDIT : I found out that the .cnf can be the .ini file (located at C:\ProgramData\MySQL\MySQL Server X.Y), so I added the ssl-x lines to it, but now I'm getting this error : </p>
  
  <pre><code> SSL connection error: ASN: bad other signature confirmation
  </code></pre>