cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect to MySQL using SSL?

fabrice7
Confirmed Champ
Confirmed Champ

Hello,

I am using Alfresco Repository CE with a MariaDB server. I am building my own Docker image based on:

https://hub.docker.com/r/alfresco/alfresco-content-repository-community

mostly by adding the MySQL connector available here:

https://downloads.mariadb.com/Connectors/java/connector-java-2.2.5/mariadb-java-client-2.2.5.jar

I noticed Alfresco can connect to the MariaDB server using an unencrypted connection, but if I require the MariaDB user to use SSL, Alfresco can't connect to MariaDB anymore.

Is it possible to configure Alfresco/MariaDB connector to use SSL to connect to the MariaDB server?

Many thanks for any help!

1 ACCEPTED ANSWER

fabrice7
Confirmed Champ
Confirmed Champ

OK, I found the answer to my own question. You need to add `useSSL=true` to the connection string. 

Example:

JAVA_OPTS="... -Ddb.url=\"jdbc:mariadb://$host:$port/$dbname?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=true\" ..."

View answer in original post

2 REPLIES 2

fabrice7
Confirmed Champ
Confirmed Champ

OK, I found the answer to my own question. You need to add `useSSL=true` to the connection string. 

Example:

JAVA_OPTS="... -Ddb.url=\"jdbc:mariadb://$host:$port/$dbname?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=true\" ..."

EddieMay
World-Class Innovator
World-Class Innovator

Hi @fabrice7

Great that you found the solution & thanks for updating us on how you did it - really useful to other users.

Thanks, 

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!