Sorry, I obviously wasn’t clear enough. The server’s cert for securing https is provided by the LetsEncrypt certificate authority, I don’t need to set my connection to insecure for that to work, but even if I try that, the same problem occurs. Testing with curl shows an “unable to parse authentication credentials” error. The problem seems to be that InfluxDB is not accepting the client certificates I want to send to it.
http section of InfluxDB configuration:
[http]
# Determines whether user authentication is enabled over HTTP/HTTPS.
auth-enabled = true
# Determines whether HTTPS is enabled.
https-enabled = true
https-ca-certificate = "/etc/ssl/my-ca/cacert.crt"
# The SSL certificate to use when HTTPS is enabled.
https-certificate = "/etc/letsencrypt/live/myhost/fullchain.pem"
# Use a separate private key location.
https-private-key = "/etc/letsencrypt/live/myhost/privkey.pem"
curl command and results:
# curl -vvvv --cacert /etc/ssl/my-ca/cacert.crt --cert /etc/ssl/client/client.crt --key /etc/ssl/client/client.key --data-urlencode "q=show databases" https://myserver:8086/query
* Trying <myip>...
* TCP_NODELAY set
* Connected to myserver (myip) port 8086 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/my-ca/cacert.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: CN=mycn
* start date: Jul 23 10:21:26 2018 GMT
* expire date: Oct 21 10:21:26 2018 GMT
* subjectAltName: host "myhost" matched cert's "myhost"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
> POST /query HTTP/1.1
> Host: myhost:8086
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Length: 18
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 18 out of 18 bytes
< HTTP/1.1 401 Unauthorized
< Content-Type: application/json
< Request-Id: d9a4e123-91c5-11e8-800e-000000000000
< Www-Authenticate: Basic realm="InfluxDB"
< X-Influxdb-Build: OSS
< X-Influxdb-Version: 1.6.0
< X-Request-Id: d9a4e123-91c5-11e8-800e-000000000000
< Date: Fri, 27 Jul 2018 17:52:38 GMT
< Content-Length: 55
<
{"error":"unable to parse authentication credentials"}
* Curl_http_done: called premature == 0
* Connection #0 to host myhost left intact
I’m not an expert on this but I have seen dumps of curl using client cert auth for connecting to other servers and in those, the TLS handshake section contains Request CERT
and CERT verify
sections. So it seems from this that the client cert isn’t being requested by InfluxDB. Please correct me if I’m wrong.
Thanks,
Simon.