Commit 71849e8
authored
xds: change clusterimpl to add SNI to handshake info (#9016)
This PR is the final PR for implementation of [gRFC
A101](https://github.com/grpc/proposal/blob/master/A101-SNI-setting-and-SNI-SAN-validation.md)
This PR does the following :
- Change NewSubconn in ClusterImpl to add the hostname to attribute of
the address so that it can be propagated to the ClientHandshake and
retrieved there to decide the SNI which can be either DNS Hostname or
endpoint Hostname if `AutoHostSni` is set , or the SNI received from
control plane. This is done because each endpoint can have a different
hostname. It is not a config that can be used across all endpoints of
the cluster , so it cannot be set in handshake info.
- Add `AutoHostSni` filed to the handshake info.
- Adds a functions to set and get hostname from address attributes. As
of now, there was a function to get the Hostname from address
balancer.Attributes and set in endpoint atrributes.
- Adds E2E tests to verify the complete SNI setting and validation flow.
- Fix comments that mention CDS balancer creates handshake info.
Note: We will turn the environment variable to true only after inter-op
tests pass.
RELEASE NOTES:
- xds: add SNI support and SAN validation behind
GRPC_EXPERIMENTAL_XDS_SNI ([gRFC
A101](https://github.com/grpc/proposal/blob/master/A101-SNI-setting-and-SNI-SAN-validation.md))1 parent 5fdb6d0 commit 71849e8
8 files changed
Lines changed: 1039 additions & 56 deletions
File tree
- credentials/xds
- internal
- credentials/xds
- xds
- balancer/clusterimpl
- server
- test/xds
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
| 648 | + | |
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
451 | | - | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
| 465 | + | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
48 | 69 | | |
49 | 70 | | |
50 | 71 | | |
| |||
58 | 79 | | |
59 | 80 | | |
60 | 81 | | |
| 82 | + | |
61 | 83 | | |
62 | 84 | | |
63 | 85 | | |
| |||
95 | 117 | | |
96 | 118 | | |
97 | 119 | | |
| 120 | + | |
98 | 121 | | |
99 | 122 | | |
100 | 123 | | |
101 | 124 | | |
102 | | - | |
| 125 | + | |
103 | 126 | | |
104 | 127 | | |
105 | 128 | | |
106 | 129 | | |
107 | 130 | | |
108 | 131 | | |
109 | 132 | | |
| 133 | + | |
110 | 134 | | |
111 | 135 | | |
112 | 136 | | |
| |||
127 | 151 | | |
128 | 152 | | |
129 | 153 | | |
130 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
131 | 161 | | |
132 | 162 | | |
133 | 163 | | |
| |||
152 | 182 | | |
153 | 183 | | |
154 | 184 | | |
155 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
156 | 196 | | |
157 | 197 | | |
158 | 198 | | |
| |||
162 | 202 | | |
163 | 203 | | |
164 | 204 | | |
165 | | - | |
166 | | - | |
| 205 | + | |
| 206 | + | |
167 | 207 | | |
168 | 208 | | |
169 | 209 | | |
170 | 210 | | |
171 | | - | |
| 211 | + | |
172 | 212 | | |
173 | 213 | | |
174 | 214 | | |
| |||
216 | 256 | | |
217 | 257 | | |
218 | 258 | | |
219 | | - | |
| 259 | + | |
220 | 260 | | |
221 | 261 | | |
222 | | - | |
| 262 | + | |
223 | 263 | | |
224 | 264 | | |
225 | 265 | | |
226 | | - | |
| 266 | + | |
227 | 267 | | |
228 | 268 | | |
229 | 269 | | |
| |||
272 | 312 | | |
273 | 313 | | |
274 | 314 | | |
275 | | - | |
| 315 | + | |
276 | 316 | | |
277 | 317 | | |
278 | 318 | | |
| |||
0 commit comments