[CONJ-856] Unable to connect with mariadb from spring boot application in SSL mode Created: 2021-02-10 Updated: 2022-08-16 Resolved: 2022-08-16 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | SSL |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Vishal Biradar | Assignee: | Diego Dupin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I have MariaDB deployed as a pod into the k8s cluster. User creation statement:
So we are not using any password while creating user. Login to DB:
So I tried enabling SSL mode on mariadb to the spring boot app side as shown below:
But I am getting an error:
Versions:
|
| Comments |
| Comment by Diego Dupin [ 2021-02-11 ] | |||
|
There is some confusion there : using client :
you indicate server certificates with 'ssl-cert' and 'ssl-ca', so SSL will be ok (hostname verification is not enabled by default with client) and ssl-key permit to indicate client private key file, to permit client authentication from server. But for java :
useSSL is ok, trustServerCertificate=true indicate to trust server certificates and disableSslHostnameVerification=true to , so that will permit to established encryption, but trusting server identity. serverSslCert information won't be used.
One way to do that is to use truststore and keystore, with simple connection string like :
And either adding server certificate to existing truststore, and client private key to existing keystore | |||
| Comment by Vishal Biradar [ 2021-02-11 ] | |||
|
@Diego Dupin |