MySQL - SSL is required but the server doesn't support it

25,126

I had a similar problem and it was solved by changing the certificate files permission.

sudo chmod 444 ca-cert.pem;
sudo chmod 444 client-cert.pem;
sudo chmod 400 client-key.pem;

sudo chmod 444 ca-cert.pem;
sudo chmod 444 server-cert.pem;
sudo chmod 400 server-key.pem;

sudo chown mysql:mysql ca-cert.pem;
sudo chown mysql:mysql client-cert.pem;
sudo chown mysql:mysql client-key.pem;

sudo chown mysql:mysql ca-cert.pem;
sudo chown mysql:mysql server-cert.pem;
sudo chown mysql:mysql server-key.pem;

Restart the server...

Share:
25,126

Related videos on Youtube

dems98
Author by

dems98

Just an ordinary Java developer, primarily on back-end.

Updated on September 02, 2020

Comments

  • dems98
    dems98 over 3 years

    I'm trying to enable SSL in MySQL. I ran the SSL Wizard on MySQL Workbench which generated these files:

    • ca-cert.pem
    • ca-key.pem
    • client-cert.pem
    • client-key.pem
    • server-cert.pem
    • server-key.pem

    Then I changed my.cnf file like this:

    [client]
    ssl-ca=<directory>/ca-cert.pem
    ssl-cert=<directory>/client-cert.pem
    ssl-key=<directory>/client-key.pem
    
    [mysqld]
    ssl-ca=<directory>/ca-cert.pem
    ssl-cert=<directory>/server-cert.pem
    ssl-key=<directory>/server-key.pem
    

    where <directory> is the directory where these files are located.

    Then I set the configuration file path in MySQL Workbench and restarted mysql service but when I test the connection it gives me this error:

    ERROR 2026 (HY000): SSL connection error: SSL is required but the server doesn't support it

    How can I solve this?

    • Dave S
      Dave S over 4 years
      What OS is the MySQL service running on?
    • dems98
      dems98 over 4 years
      @DaveS Ubuntu 18.04.3 LTS
    • Alfabravo
      Alfabravo over 4 years
      WOrkbench sits in the same machine as MYSQL server?
    • dems98
      dems98 over 4 years
      @Alfabravo Yes it's all in localhost
    • Alfabravo
      Alfabravo over 4 years
      Restarted the mysql-server service after changing configuration?
    • dems98
      dems98 over 4 years
      @Alfabravo Yes, I wrote it in the question
    • Max Raskolnikov
      Max Raskolnikov over 2 years
      Can I connect without SSL? HeidiSQL is able to make it, but MySQL WB couldn't :(
  • dems98
    dems98 over 4 years
    I've changed these lines but it always gives me the error
  • Prabhjot Singh Kainth
    Prabhjot Singh Kainth over 4 years
    can you post <directory>?
  • dems98
    dems98 over 4 years
    I've followed this link dev.mysql.com/doc/workbench/en/…
  • Alfabravo
    Alfabravo over 4 years
    @Demetrio Odd because the suggestion done in the answer is actually in the document you link to and the conf data you provided did not. Did you see the message stated in step 6?
  • dems98
    dems98 over 4 years
    @Alfabravo No it didn't appear
  • Alfabravo
    Alfabravo over 4 years
    Then it is not properly configured.
  • dems98
    dems98 over 3 years
    I've changed the ownership and permissions of .pem files and moved the client .pem files in a directory and the server .pem in another; it works but only if I use the mysql client with sudo, maybe because the client files are owned by mysql user. Is there a way to connect without sudo?
  • Jonathan Martins
    Jonathan Martins over 3 years
    I do connect without sudo, I think this is possible because the certificate files are owned by mysql user.
  • S.M.Mousavi
    S.M.Mousavi about 2 years
    final sentence is important "Restart the server..."