Commit 23e2f2b
committed
tls: support TLS-in-TLS for HTTPS proxy tunnels
Two related changes:
SNI priority fix: when the TLS context carries an explicit vhost
(e.g. the proxy hostname on a proxy TLS context), that vhost now
takes priority over proxied_host in flb_tls_session_create.
Previously proxied_host was used unconditionally for upstream
connections, causing the proxy TLS handshake to advertise the
destination hostname instead of the proxy hostname.
TLS-in-TLS chaining: add session_set_outer to struct flb_tls_backend
and implement tls_session_set_outer in the OpenSSL backend using
BIO_f_ssl. When flb_tls_session_create detects an existing
tls_session on the connection (the proxy TLS session), it chains
the new inner session's I/O through the outer session via
SSL_set_bio, so that the destination TLS handshake travels inside
the already-established proxy TLS tunnel rather than going directly
to the raw socket.
Signed-off-by: Antônio Franco <13881523+antoniomrfranco@users.noreply.github.com>1 parent 0bd5c2e commit 23e2f2b
3 files changed
Lines changed: 99 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
621 | 630 | | |
622 | 631 | | |
623 | 632 | | |
624 | | - | |
625 | | - | |
626 | | - | |
| 633 | + | |
627 | 634 | | |
628 | 635 | | |
629 | 636 | | |
| |||
643 | 650 | | |
644 | 651 | | |
645 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
646 | 687 | | |
647 | 688 | | |
648 | 689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
1279 | 1280 | | |
1280 | 1281 | | |
1281 | 1282 | | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1282 | 1312 | | |
1283 | 1313 | | |
1284 | 1314 | | |
1285 | 1315 | | |
| 1316 | + | |
1286 | 1317 | | |
1287 | 1318 | | |
1288 | 1319 | | |
| |||
1296 | 1327 | | |
1297 | 1328 | | |
1298 | 1329 | | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
1299 | 1344 | | |
1300 | 1345 | | |
1301 | 1346 | | |
| |||
1688 | 1733 | | |
1689 | 1734 | | |
1690 | 1735 | | |
| 1736 | + | |
1691 | 1737 | | |
1692 | 1738 | | |
1693 | 1739 | | |
| |||
0 commit comments