Skip to content

remote: avoid tls error if both key and cert are not set#1693

Merged
tonistiigi merged 1 commit intodocker:masterfrom
jedevc:remote-tls-missing-key-cert
Mar 23, 2023
Merged

remote: avoid tls error if both key and cert are not set#1693
tonistiigi merged 1 commit intodocker:masterfrom
jedevc:remote-tls-missing-key-cert

Conversation

@jedevc
Copy link
Copy Markdown
Collaborator

@jedevc jedevc commented Mar 23, 2023

🛠️ Fixes what appears to be an oversight I made in #1078.

Previously, we would explicitly error if all TLS parameters were not available. However, it is a perfectly valid use case to connect to a buildkit server that only serves TLS but which does not verify the client (which is possible today with buildctl) - see moby/buildkit#236 (comment):

  • Use a certificate and key on the server and a ca-certificate at the client
    • an ephemeral key exchange is performed
    • the client verifies the server certificate

To support this use case, we only need to error if only one of key or cert is set, and the other is not - if both are unspecified, the client will not present a certificate to the server.

Previously, we would explicitly error if all TLS parameters were not
available. However, it is a perfectly valid use case to connect to a
buildkit server that only provides TLS in one direction to verify the
server (which is possible today with buildctl).

To support this use case, we only need to error if only one of key or
cert is set, and the other is not - if both are unspecified, the client
will not present a certificate to the server.

Signed-off-by: Justin Chadwell <[email protected]>
@tonistiigi tonistiigi merged commit 948414e into docker:master Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants