I am trying to migrate from a local grafana server instance running on my laptop, to a Grafana Cloud server instance.
My (remote) postgres server requires that clients connect with ssl certs, not username/password. On my local Grafana server, I set sslmode = ‘require’, and pass the paths to my client ssl cert and key in env variables or .ini file. Grafana has no difficulty connecting and making queries to my postgres db.
HOWEVER, when I set up my Grafana Cloud instance, I know of no way to pass the Grafana Cloud server instance my client ssl cert and key. So when I attempt to configure postgres, I receive the following error:
‘pq: connection requires a valid client certificate’
Is there a mechanism for doing this? Any help would be appreciated.
In my hosted Grafana server config I can find where to specify sslmode but I cannot find where to specify sslcert, sslkey and sslrootcert.
(BTW, I had to convert the private key in order to make it work: openssl pkcs8 -topk8 -inform PEM -outform DER -in client-cert.pem -out client-cert.pk8 -nocrypt)
I am able to easily run Grafana on my laptop, and have no problems accessing my (internet-accessible) PostgreSQL DB, using SSL.
I gave up on Grafana Cloud in June. I thought I would try it once again this weekend, before turning to other online services. Once again, the Grafana Cloud offering has disappointed and frustrated me.
WRT using yaml to provision PostgreSQL connectivity, Grafana Cloud does not permit me to submit a yaml file (other than by contacting support, which to me is a non-starter for a web service).
I have resorted to using the API to update my PostgreSQL datasource configuration. After a couple of hours, I was able to GET and PUT my PostgreSQL configuration, by translating the datasource provisioning yaml into JSON.
I am able to successfully change parameters as expected, although I am unable to confirm that my keys (passed in secureJSON) were received correctly, as the secureJSON is (correctly) never returned. And despite using the same PostgreSQL certs for my local Grafana instance as well as for dBeaver, Grafana Cloud still fails to connect with my PostgreSQL DB with: ‘pq: connection requires a valid client certificate’
I am also facing the same error "
pq: connection requires a valid client certificate" while trying to configure SSL connection in (custom.ini) Grafana to Postgresql in windows 10.
Please find the below parameters which i have enabled in the custom.ini file.
Protocol (http, https, h2, socket)
protocol = http
The ip address to bind to, empty will bind to all interfaces
;http_addr =
The http port to use
http_port = 3000
The public facing domain name used to access grafana from a browser
;domain = localhost
Redirect to correct domain if host header does not match domain
Prevents DNS rebinding attacks
;enforce_domain = false
The full public facing url you use in browser, used for redirects and emails
If you use reverse proxy and sub path specify full url (with sub path)