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

Enable TLS in vault #455

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Enable TLS in vault #455

merged 1 commit into from
Aug 7, 2024

Conversation

ashu3103
Copy link
Collaborator

@ashu3103 ashu3103 commented Aug 4, 2024

WIP: Enable TLS between curl and pgagroal-vault

About this commit

This commit is aimed to integrate the tls mode in pgagroal-vault similar to pgagroal for secure connections.

  • Add required fields in the vault configuration like tls, tls_cert_file, tls_ca_file and tls_key_file
  • Before handling the HTTP request, the vault will check whether the client wants to initiate TLS Handshake with ClientHello by peeking the first few bytes of the data after the establishing the connection and checking it against the ClientHello bytes.
  • Case1: If client initiates the TLS Handshake and config->tls is on, both server and client will do the TLS handshake and then server handles the upcoming HTTP request.
  • Case2: If client doesn't initiates the TLS Handshake and config->tls is on, the server will bypass TLS handshake and instead server handles the incoming HTTP request.
  • Case3: If client initiates the TLS Handshake and config->tls is off, the server will simply closes the connection and report appropriate errors.

@jesperpedersen PTAL

@jesperpedersen
Copy link
Collaborator

We need to remove Case 2 - if TLS is on then it is mandatory for the clients

@ashu3103
Copy link
Collaborator Author

ashu3103 commented Aug 7, 2024

We need to remove Case 2 - if TLS is on then it is mandatory for the clients

Done.

If Case 2 is encountered, an HTTP message with 301 (Redirect Message) code will be sent.

@jesperpedersen PTAL.

@jesperpedersen jesperpedersen merged commit 5fae10c into agroal:master Aug 7, 2024
2 checks passed
@jesperpedersen
Copy link
Collaborator

Merged.

Thanks for your contribution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants