How to connect to MySQL using SSL?

cancel
Showing results for 
Search instead for 
Did you mean: 
fabrice7
Partner

How to connect to MySQL using SSL?

Jump to solution

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 Solution

Accepted Solutions
fabrice7
Partner

Re: How to connect to MySQL using SSL?

Jump to solution

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 solution in original post

2 Replies
fabrice7
Partner

Re: How to connect to MySQL using SSL?

Jump to solution

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
Alfresco Employee

Re: How to connect to MySQL using SSL?

Jump to solution

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!