This repository was archived by the owner on May 8, 2026. It is now read-only.
Commit 6d32ba2
authored
Expose QuicSslContextBuilder::sni (#851)
**Motivation:**
In order to be able to receive the `SniCompletionEvent` sni mapping
needs to be used, however, the function
`QuicSslContextBuilder::buildForServerWithSni` doesn't allow setting
`ClientAuth` and alternativly the builder doesn't allow setting the SNI
mapping.
This means there is currently no way to use both SNI mapping and
support/enforce client certs with QUIC.
**Modification:**
Expose the `QuicSslContextBuilder::sni` so that its possible to create a
`QuicSslContext` with SNI mapping alongside other settings.
Also adds `QuicChannelConnectTest::testSniWithClientAuth` to validate
**Result:**
The following then works to allow both receiving the
`SniCompletionEvent` and require a client cert
```
// Build context with clientAuth and trustManager configured
QuicSslContext sniContext = QuicSslContextBuilder.forServer(key, null, cert)
.applicationProtocols("alpn/1")
.clientAuth(ClientAuth.REQUIRE)
// ...
.build();
// Create SNI-enabled context using the builder's sni() method
QuicSslContext serverContext = QuicSslContextBuilder.forServer(key, null, cert)
.clientAuth(ClientAuth.REQUIRE)
.sni(hostname -> sniContext)
.build();
```
Port of netty/netty#161781 parent 5a7b6ef commit 6d32ba2
2 files changed
Lines changed: 92 additions & 1 deletion
File tree
- codec-classes-quic/src/main/java/io/netty/incubator/codec/quic
- codec-native-quic/src/test/java/io/netty/incubator/codec/quic
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
183 | 203 | | |
184 | 204 | | |
185 | 205 | | |
| |||
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1542 | 1542 | | |
1543 | 1543 | | |
1544 | 1544 | | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
1545 | 1616 | | |
1546 | 1617 | | |
1547 | 1618 | | |
| |||
0 commit comments