Commit Graph

5 Commits

Author SHA1 Message Date
Nick Ufer 92a9e105cc
feat: makes mutual TLS optional for postgres, mysql/mariadb and grpc (#244)
* feat: makes mutual TLS optional for postgres and mysql

* feat: makes mutual TLS optional for gRPC

* refactor: replaces deprecated grpc.WithInsecure()

* docs: changes meaning of grpc tls option to client cert

* chore: updates test go version to same as project version (1.18)

* test: adds TLS and mutual TLS support to db and grpc test environments

* chore: adds generated test certificates to .gitignore

* chore: reduces test certificates to minimum key usage

* chore: adds second client certificate which acts as unauthorized

* test: adds mysql tls and mutual tls tests

* refactor: postgres ssl config check

* refactor: change connectTries to 0 for postgres to only have 1 retry by default like mysql

* refactor: postgres sslmode and sslrootcert code

* test: adds postgres tls and mutual tls tests

* fix: treat grpc authOpts grpc_ca_cert, grpc_tls_cert, grpc_tls_key as file paths instead of actual file contents

refactor: improves error logging

* test: adds grpc tls and mutual tls tests

* Fix postgres ssl modes `require`, ``verify-ca` and `verify-full` to work without explicit root certificate.

* refactor: adds warning for unknown pg_sslmode

style: removes empty lines

* style: compress switch case

Co-authored-by: Martin Abbrent <martin.abbrent@ufz.de>
2022-10-05 16:32:36 -03:00
Ignacio Gómez 290c1c516a
Add gRPC options to set timeout and skip dial errors (#193)
* Don't bubble up grpc client error, just keep it nil and derive it again on checking.

Add option to check if we should faild on gRCP dial error or not.

Add timeout option.

* Instead of attempting on each check, remove with block when fail on dial error is not set to true so gRPC takes care of the connection itself.
Add tests to check that auth fails with dial errors, but works once the service is back up.

* Fix docker files missing libwebsockets8 by building from source, fix docker test run by starting maridb service instead of mysql one.

Co-authored-by: Ignacio Gómez <ignacio_gomez@apple.com>
2021-09-15 13:46:44 -03:00
Pierre Fersing b5c925d119 Allow to get a shell on Docker testing image
This make much easier to re-run test multiple time without avoid to wait
backends to start each time.
2021-02-13 15:07:26 +01:00
Pierre Fersing 7b18c44ff1 In Docker testing image, start all services first
This avoid trying to access service while it still starting. This
happened with Redis cluster.
2021-02-10 20:02:26 +01:00
Pierre Fersing 33bfc226c7 Add Docker image to run tests 2020-11-13 16:33:15 +01:00