Add NewProxyAutoTLSTransport and DialTLSWithBackOff to support TLS proxy#2479
Conversation
…S proxy Part of: knative/serving#12503 PoC: knative/serving#12815 This patch `NewProxyAutoTLSTransport` which is `NewProxyAutoTransport + TLS config. Current proxy does not support TLS but it needs for knative/serving#12503. `DialTLSWithBackOff` is also `DialWithBackOff` + TLS config. It needs `newH2Transport` which handles HTTP2 with TLS.
Codecov Report
@@ Coverage Diff @@
## main #2479 +/- ##
==========================================
+ Coverage 81.32% 81.71% +0.39%
==========================================
Files 163 163
Lines 6499 9653 +3154
==========================================
+ Hits 5285 7888 +2603
- Misses 981 1529 +548
- Partials 233 236 +3
Continue to review full report at Codecov.
|
evankanderson
left a comment
There was a problem hiding this comment.
Do we want the ability to fall back to non-TLS transport during the transition if TLS is refused?
|
I think we don't need it for now. AFAIK, the users, who requested this feature, want to use the strictly secure connection and they will complain about the fall-back feature if we added 😅 |
|
I think we need a transition plan for "current config" to "always secure". We can end up with any of the following transition scenarios:
I think we want to not serve errors during the update process, which means we either need a way to ensure we know the ordering, or have the ability to fall back to insecure during the transition and then "lock the gate" with a second config change Full disclosure: I'd like to turn this on for every Knative user, all the time, in some future release. |
|
I see. In this case, knative/serving#12815 supports
and so we should ensure the ordering? Just in case, I verified the scinario |
|
does this PR need to get in before we cut |
|
Yes, I hope so... ping @evankanderson @rhuss @skonto could you please review this? |
If you want to enforce the ordering, there needs to be a way to enable the (The same problem applies with ingress -> activator, BTW) |
|
I implemented current PRs in serving repos as The ingress -> activator is same. Activator serves on both HTTP and HTTPS ports. |
evankanderson
left a comment
There was a problem hiding this comment.
A few more comments, but most should be straightforward.
| bo.Steps = 2 | ||
|
|
||
| // Timeout. Use special testing IP address. | ||
| c, err = dialBackOffHelper(context.Background(), "tcp4", "198.18.0.254:8888", bo, tlsConf) |
There was a problem hiding this comment.
Could this use a localhost address rather than some Internet IP?
Alternately, use one of the documentation IP ranges so our tests aren't accidentally hitting a real IP.
There was a problem hiding this comment.
(i.e. use 127.200.100.10:8888)
There was a problem hiding this comment.
Another PR #2402 is changing it now (and it seems we need a little bit big change for this) so I leave it as it is.
There was a problem hiding this comment.
My concern was that this is a real IP owned by Oracle, but I'm not going to block this PR on it.
|
Thank you! Updated. |
| bo.Steps = 2 | ||
|
|
||
| // Timeout. Use special testing IP address. | ||
| c, err = dialBackOffHelper(context.Background(), "tcp4", "198.18.0.254:8888", bo, tlsConf) |
There was a problem hiding this comment.
My concern was that this is a real IP owned by Oracle, but I'm not going to block this PR on it.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson, nak3 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Part of: knative/serving#12503
PoC: knative/serving#12815
This patch
NewProxyAutoTLSTransportwhich is `NewProxyAutoTransport + TLS config.Current proxy does not support TLS but it needs for knative/serving#12503.
DialTLSWithBackOffis alsoDialWithBackOff+ TLS config. It needsnewH2Transportwhich handles HTTP2 with TLS./cc @evankanderson @skonto @rhuss