Skip to content

Error when connecting to server without SSL #234

@sschlenkrich

Description

@sschlenkrich

Hi, I encontered the following error with MySQL.jl v1.5.1 and MariaDB_Connector_C_jll v3.4.8+0:

ERROR: (2026): TLS/SSL error: SSL is required, but the server does not support it

Unfortunately, using option ssl_mode = MySQL.API.SSL_MODE_DISABLED did not resolve the issue.

My understanding is, the error is related to the MariaDB_Connector_C_jll package. Enforcing an earlier version (e.g. v3.3.9) of MariaDB_Connector_C_jll works around the error. But my understanding is, that MySQL.jl should also work with newer versions of MariaDB_Connector_C_jll.

Below is a MWE for the error. I use dolt to setup a DB server.

Could it be that the option ssl_mode = MySQL.API.SSL_MODE_DISABLED is not enough to disable the client requirements for SSL encryption?


Navigate to a folder and initialise an empty database repository.

dolt init

Start the database server.

dolt sql-server

This yields the following info messages:

Starting server with Config HP="localhost:3306"|T="28800000"|R="false"|L="info"
...

Start Julia with an empty project and add MySQL. This yields

   Resolving package versions...
    Updating `...\MySQL_Issue\Project.toml`
  [39abe10b] + MySQL v1.5.1
    Updating `...\MySQL_Issue\Manifest.toml`
  ...
  [39abe10b] + MySQL v1.5.1
  ...
  [aabc7e14] + MariaDB_Connector_C_jll v3.4.8+0
  ...

The error occurs when running the following commands:

julia> using MySQL
julia> DBInterface.connect(MySQL.Connection, "localhost", "root", "")
ERROR: (2026): TLS/SSL error: SSL is required, but the server does not support it
Stacktrace:
 [1] 
   @ MySQL.API C:\Users\sebas\.julia\packages\MySQL\JGiss\src\api\capi.jl:12
 [2] MySQL.Connection(host::String, user::String, passwd::String, db::String, port::Int64, unix_socket::String; kw::@Kwargs{})
   @ MySQL C:\Users\sebas\.julia\packages\MySQL\JGiss\src\MySQL.jl:36
 [3] Connection
   @ C:\Users\sebas\.julia\packages\MySQL\JGiss\src\MySQL.jl:26 [inlined]
 [4] connect(::Type{MySQL.Connection}, host::String, user::String, passwd::String)
   @ MySQL C:\Users\sebas\.julia\packages\MySQL\JGiss\src\MySQL.jl:294
 [5] top-level scope
   @ REPL[3]:1
Some type information was truncated. Use `show(err)` to see complete types.

Workaround: Adding MariaDB_Connector_C_jll explicitly with a compat entry MariaDB_Connector_C_jll = "~3.3" resolves the error:

julia> DBInterface.connect(MySQL.Connection, "localhost", "root", "")
MySQL.Connection(host="localhost", user="root", port="3306", db="")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions