# X509 everywhere when using Azure Mysql

**URL:** <https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824>\
**Category:** Installation\
**Tags:** datasource, sql\
**Created:** [January 25, 2024, 10:34am UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824 "2024-01-25T10:34:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![antoinedhersin](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@antoinedhersin](https://community.grafana.com/u/antoinedhersin)\
**Post date:** [January 25, 2024, 10:34am UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824/1 "2024-01-25T10:34:34Z")

</div>

Hi, we just deployed a Grafana 8.4 as a container on Azure, and everything is working fine. Then we create a Mysql Managed database to store the Grafana configuration.

We use the configuration:

GF\_DATABASE\_SSL\_MODE: true  
GF\_DATABASE\_CA\_CERT\_PATH: /etc/ssl/certs/DigiCertGlobalRootCA.crt.pem  
GF\_DATABASE\_TYPE: MySQL

And we’re able to connect to MySQL and store our data.

–

The weird thing is that all the other data sources show a x509 certificate signed by unknown authority.

For example, the managed Elasticsearch running on Azure, Azure monitor…

All our connections to an SSL service are showing a x509 error.

Do you know what we should do to correct this behavior?

Thanks

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [January 25, 2024, 10:50am UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824/2 "2024-01-25T10:50:57Z")

</div>

Datasources have own TLS management usually:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/f/c/fc3d7cbf80af9ecb35dee362a48f9c0597ed8bf7.png)

You may try to add CA certs to your OS CA certs, so they then can be recognized by Grafana binary.

---

<div class="post-metadata">

**Author:** ![antoinedhersin](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@antoinedhersin](https://community.grafana.com/u/antoinedhersin)\
**Post date:** [January 25, 2024, 10:53am UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824/3 "2024-01-25T10:53:59Z")

</div>

Hi, in fact we use mysql as the internal storage of Grafana not as a datasource.

When using Mysql as an internal database, we can’t connect to other SSL/TLS services. For example we need to skip verify Elasticsearch datasource and we can’t connect to Azure Monitor:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/1/b/1b42b4097ad9e57c7d5757c97afae09efe2c5647.jpeg)

---

<div class="post-metadata">

**Author:** ![antoinedhersin](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@antoinedhersin](https://community.grafana.com/u/antoinedhersin)\
**Post date:** [January 25, 2024, 9:29pm UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824/4 "2024-01-25T21:29:39Z")

</div>

As a side note, we don’t have this issue when we deploy a Grafana with self database (SQL LITE) so I’m quite sure it’s related to the usage of Azure MySQL but I’ve no clue of what’s happening or what we may change on Azure MySQL configuration…

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [January 25, 2024, 10:22pm UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824/5 "2024-01-25T22:22:58Z")

</div>

You didn’t show your full config. But I guess you are overwriting whole /etc/ssl/certs/ folder in the container, so container doesn’t recognise other CAs then 🤷‍♂️

I don’t understand why you need DigiCertGlobalRootCA.crt.pem, when Digicert is standard CA and standard Grafana images already have all standard CA certs, e.g.:

```auto
root@play:~# docker run --rm --entrypoint sh -ti grafana/grafana:8.4.0
/usr/share/grafana $ ls -lah /etc/ssl/certs | grep -i 'DigiCert_Global_Root_CA'
lrwxrwxrwx 1 root root 35 Feb 16 2022 3513523f.0 -> ca-cert-DigiCert_Global_Root_CA.pem
lrwxrwxrwx 1 root root 62 Feb 16 2022 ca-cert-DigiCert_Global_Root_CA.pem -> /usr/share/ca-certificates/mozilla/DigiCert_Global_Root_CA.crt
/usr/share/grafana $ openssl x509 -text -noout -in /usr/share/ca-certificates/mozilla/DigiCert_Global_Root_CA.crt
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            08:3b:e0:56:90:42:46:b1:a1:75:6a:c9:59:91:c7:4a
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
        Validity
            Not Before: Nov 10 00:00:00 2006 GMT
            Not After : Nov 10 00:00:00 2031 GMT
        Subject: C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA

```

---

<div class="post-metadata">

**Author:** ![antoinedhersin](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@antoinedhersin](https://community.grafana.com/u/antoinedhersin)\
**Post date:** [January 26, 2024, 7:39am UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824/6 "2024-01-26T07:39:30Z")

</div>

Yes you’re right, just found that the whole folder was bind mounted instead of just the Mysql certificate. So the certificates folder is empty, except for one Mysql certificate. Thank you for your help

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [February 12, 2024, 9:19pm UTC](https://community.grafana.com/t/x509-everywhere-when-using-azure-mysql/112824/7 "2024-02-12T21:19:15Z")

</div>

It will be nice if you close your issue ([Product Area: x509 errors on all datasources · Issue #80994 · grafana/grafana · GitHub](https://github.com/grafana/grafana/issues/80994) )  
Anyway, it was not a Grafana issue, but your configuration problem.
