Skip to content

Conversation

@dmcgowan
Copy link
Member

The TLS fallback should only be used when the protocol is ambiguous due to provided TLS configurations and defaulting to http. Do not add TLS configurations when defaulting to http. When the port is 80 or will be defaulted to 80, there is no protocol ambiguity and TLS fallback should not be used.

Alternative to #9269

@AkihiroSuda AkihiroSuda added cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Oct 23, 2023
@dmcgowan dmcgowan force-pushed the tls-default-behavior branch 2 times, most recently from 28f2339 to b458aa2 Compare October 23, 2023 17:36
@dmcgowan dmcgowan marked this pull request as draft October 23, 2023 18:25
@dmcgowan dmcgowan force-pushed the tls-default-behavior branch from b458aa2 to f7f8ac3 Compare October 23, 2023 19:12
@dmcgowan dmcgowan marked this pull request as ready for review October 23, 2023 20:07
@dmcgowan dmcgowan force-pushed the tls-default-behavior branch from f7f8ac3 to c75b129 Compare October 24, 2023 13:14
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit and a question regarding error messaging to explain the changes...

// the protocol from the port number is ambiguous, use the
// docker.HTTPFallback roundtripper to catch TLS errors and re-attempt the
// request as http. This allows preference for https when configured but
// also catches TLS errors early enough in the request to avoid sending
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this "flavor" pass through to enhance the error messaging and let the error show as trying https first based on (tryTLSFirst) is enabled?

would be nice if the error messaging was obvious telling the user what to do to address config changes.. for each testable situation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an info log for this case

The TLS fallback should only be used when the protocol is ambiguous due
to provided TLS configurations and defaulting to http. Do not add TLS
configurations when defaulting to http. When the port is 80 or will be
defaulted to 80, there is no protocol ambiguity and TLS fallback should
not be used.

Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan force-pushed the tls-default-behavior branch from a7c832f to d48ceb6 Compare October 25, 2023 03:35
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikebrow mikebrow added this pull request to the merge queue Oct 25, 2023
Merged via the queue into containerd:main with commit 43d3cb9 Oct 25, 2023
@dmcgowan dmcgowan added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch and removed cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants