Gerrit and MySQL with SSL enabled

582 views
Skip to first unread message

Vladislav Khudyakov

unread,
Nov 23, 2017, 10:35:55 AM11/23/17
to Repo and Gerrit Discussion
Hi, I'm trying to init gerrit with MySQL server where SSL mode is enabled
And after init I have following error:

fatal
: DbInjector failed
fatal
: Unable to determine SqlDialect
fatal
:   caused by java.sql.SQLException: SSL connection is required. Please specify SSL options and retry.

I can't see any SSL related option in DB section in documentation.
Is there any way to get it work? 

Hugo Arès

unread,
Nov 23, 2017, 4:05:57 PM11/23/17
to Repo and Gerrit Discussion
To pass options to the driver such as the one to use ssl, you normally need to set
database.url instead of the separate settings and put ?someOption=value in the url,
right after the database name.

On my side, I still use the separate settings (database.hostname, database.database,...) and
because I know gerrit will build the jdbc url from them, I pass the jdbc properties by appending
them to the database name:

[database]
    database = reviewDB?someOption=value

You need to check the mySQL connector documentation but I think the parameter you need is
useSSL=true:

[database]
    database = reviewDB?useSSL=true

regards,
Hugo
Reply all
Reply to author
Forward
0 new messages