Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS termination for incoming client connection #364

Merged
merged 16 commits into from
Nov 5, 2023

Conversation

mostafa
Copy link
Member

@mostafa mostafa commented Nov 5, 2023

Ticket(s)

Description

This PR adds TLS termination for incoming Postgres clients, which helps enable the following scenarios:

  1. Client disables SSL:
%%{init: {'theme': 'base'} }%%
flowchart LR
    A(Client) <-->|plaintext| B(GatewayD)
    B <-->|plaintext| C(DBMS)
Loading
  1. Client prefers SSL:
%%{init: {'theme': 'base'} }%%
flowchart LR
    A(Client) <-->|plaintext if TLS disabled, encrypted otherwise| B(GatewayD)
    B <-->|plaintext| C(DBMS)
Loading
  1. Client requires SSL:
%%{init: {'theme': 'base'} }%%
flowchart LR
    A(Client) <-->|encrypted if TLS enabled, rejected otherwise| B(GatewayD)
    B <-->|plaintext| C(DBMS)
Loading

Related PRs

Development Checklist

  • I have added a descriptive title to this PR.
  • I have squashed related commits together.
  • I have rebased my branch on top of the latest main branch.
  • I have performed a self-review of my own code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added docstring(s) and type annotations to my code.
  • I have made corresponding changes to the documentation (docs).
  • I have added tests for my changes.

Legal Checklist

@mostafa mostafa linked an issue Nov 5, 2023 that may be closed by this pull request
@mostafa mostafa force-pushed the tls-termination-for-server branch 2 times, most recently from 8029d5f to ce62043 Compare November 5, 2023 12:46
@mostafa mostafa force-pushed the tls-termination-for-server branch 5 times, most recently from 27602e5 to 365cdc0 Compare November 5, 2023 16:11
Disable metric tests for now, as they are highly flaky
@mostafa mostafa force-pushed the tls-termination-for-server branch 3 times, most recently from 1c6664a to 9a49142 Compare November 5, 2023 17:28
Stop metrics server gracefully
Run stop gracefully goroutine after running the server
@mostafa mostafa force-pushed the tls-termination-for-server branch 2 times, most recently from ef8146e to d9a87f5 Compare November 5, 2023 18:30
@mostafa mostafa force-pushed the tls-termination-for-server branch from d9a87f5 to 91db586 Compare November 5, 2023 18:43
@mostafa mostafa merged commit aeef306 into main Nov 5, 2023
2 checks passed
@mostafa mostafa deleted the tls-termination-for-server branch November 5, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client: TLS termination of incoming connections from database clients
1 participant