vscode-sqltools icon indicating copy to clipboard operation
vscode-sqltools copied to clipboard

Connect to azure mysql - ssl - get error UNKNOWN_CODE_PLEASE_REPORT: SSL connection is required. Please specify SSL options and retry.

Open diepes opened this issue 4 years ago • 4 comments

Describe the bug A clear and concise description of what the bug is. Install SQLTools, enter azure details. Click TEST CONNECTION

To Reproduce Steps to reproduce the behavior:

  1. Go to '...' SQLTOOLS
  2. Click on '....' MYSQL
  3. Fill credentials '....'
  4. Click TEST CONNECTION
  5. Receive warning in RED "UNKNOWN_CODE_PLEASE_REPORT: SSL connection is required. Please specify SSL options and retry."

Expected behavior A clear and concise description of what you expected to happen. There to be a [ ] use ssl option

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

  • SQLTools Version [ v0.21.6]
  • VSCode Version: [1.41.1]
  • Driver Used/Version: [ MySQL 6]
  • OS: [ Linux ]

Additional context Add any other context about the problem here.

diepes avatar Jan 28 '20 23:01 diepes

can you share your settings from json file?

https://vscode-sqltools.mteixeira.dev/driver/mssql#11-specific-options should help.

You probably need to add encrypt: true to your options.

mtxr avatar Feb 07 '20 23:02 mtxr

Still have problems?

mtxr avatar May 13 '20 06:05 mtxr

I have the same problem.

With Azure MySQL and MariaDB databases, by default, it requires a certificate to connect. https://docs.microsoft.com/en-us/azure/mysql/howto-configure-ssl

Is this something currently supported by this extension?

Edit:

I got it working from the docs.

Here is a connection profile that works with Azure databases:

{
      "database": "foobar",
      "dialect": "MySQL",
      "name": "FooBar",
      "password": "foobar123",
      "port": 3306,
      "server": "foobar-srv.mysql.database.azure.com",
      "username": "user@foobar-srv",
      "mysqlOptions": {
        "ssl": true
      }
}

We just have to add the ssl true part. Very simple, I thought I might have to point to the BaltimoreCyberTrustRoot certificat they refer to in the Azure docs.

EtienneBourque avatar May 13 '20 16:05 EtienneBourque

Hi there @mtxr

i'm able to connect to the DB , but when run query got same error as show in the screenshot. image

VS Code 1.55.2 Description: SQLTools MySQL/MariaDB Version: 0.2.0 Name: SQLTools Version: 0.23.0 OS : Windows 10 ver 20h2

{
    "sqltools.connections": [
      
    {
        "mysqlOptions": {
          "authProtocol": "default",
          "ssl" : true,
          "encrypt": true
        },
        "previewLimit": 50,
        "server": "test-nonlive.mysql.database.azure.com",
        "port": 3306,
        "driver": "MySQL",
        "name": "test-nonlive",
        "database": "test_depo",
        "username": "test_readuser",
        "password": "test123123",
        "connectionTimeout": 10000
      }
     
    ]
}

ongkokl avatar Apr 29 '21 09:04 ongkokl