Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
diepes opened this issue Jan 28, 2020 · 4 comments
Labels
mysql MySQL / MariaDB driver question

Comments

@diepes
Copy link

diepes commented Jan 28, 2020

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 diepes added the triage label Jan 28, 2020
@mtxr
Copy link
Owner

mtxr commented Feb 7, 2020

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 mtxr added the mssql Microsoft SQL Server driver label Feb 7, 2020
@triage-new-issues triage-new-issues bot removed the triage label Feb 7, 2020
@mtxr mtxr added the question label Feb 7, 2020
@mtxr
Copy link
Owner

mtxr commented May 13, 2020

Still have problems?

@EtienneBourque
Copy link

EtienneBourque commented May 13, 2020

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.

@ongkokl
Copy link

ongkokl commented Apr 29, 2021

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
      }
     
    ]
}

@gjsjohnmurray gjsjohnmurray added mysql MySQL / MariaDB driver and removed mssql Microsoft SQL Server driver labels Jul 27, 2022
@gjsjohnmurray gjsjohnmurray mentioned this issue Jul 31, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mysql MySQL / MariaDB driver question
Projects
None yet
Development

No branches or pull requests

5 participants