ribbybibby / ssl_exporter

Exports Prometheus metrics for TLS certificates
Apache License 2.0
520 stars 97 forks source link

Test certs expired in March #27

Closed CowEther closed 4 years ago

CowEther commented 4 years ago

Builds are failing because the hard-coded client and server test certs have expired. The test certs need to be regenerated (or possibly find a way to create the at test runtime).

Steps to reproduce:

  1. Checkout master
  2. Run make or docker build

Actual Behavior: GO111MODULE=on go test -race -mod=vendor ./... 2020/05/18 16:15:03 http: TLS handshake error from 127.0.0.1:61858: remote error: tls: bad certificate time="2020-05-18T16:15:03-04:00" level=error msg="Get \"https://127.0.0.1:61857\": x509: certificate has expired or is not yet valid: current time 2020-05-18T16:15:03-04:00 is after 2020-03-28T07:52:27Z" source="ssl_exporter.go:108"

Expected Behavior: Certs expected to not be expired are not expired, tests pass successfully.

ribbybibby commented 4 years ago

Thank you for bringing this to my attention @CowEther! It was certainly very short sighted on my part not to at least set a reminder for this..

I've renewed the certificates and given them a much longer validity period (10 years): https://github.com/ribbybibby/ssl_exporter/commit/1305aac408a2c9bfd40547c404209865a17f8821. I've also set a reminder for my future self.

As you mentioned, it might be better to generate these certs at runtime. I'll have a quick look at the best way to achieve that.

ribbybibby commented 4 years ago

Certificates are now generated for tests on the fly as of #34.