fix some tests and prepare next step of evolution
This commit is contained in:
@@ -184,14 +184,28 @@ export class RouteConnectionHandler {
|
||||
const needsTlsHandling = allRoutes.some(route => {
|
||||
// Check if route matches this port
|
||||
const matchesPort = this.smartProxy.routeManager.getRoutesForPort(localPort).includes(route);
|
||||
|
||||
return matchesPort &&
|
||||
route.action.type === 'forward' &&
|
||||
route.action.tls &&
|
||||
(route.action.tls.mode === 'terminate' ||
|
||||
|
||||
return matchesPort &&
|
||||
route.action.type === 'forward' &&
|
||||
route.action.tls &&
|
||||
(route.action.tls.mode === 'terminate' ||
|
||||
route.action.tls.mode === 'passthrough');
|
||||
});
|
||||
|
||||
// Auto-calculate session ticket handling based on route configuration
|
||||
// If any route on this port terminates TLS, allow session tickets (HttpProxy handles resumption)
|
||||
// Otherwise, block session tickets (need SNI for passthrough routing)
|
||||
const hasTlsTermination = allRoutes.some(route => {
|
||||
const matchesPort = this.smartProxy.routeManager.getRoutesForPort(localPort).includes(route);
|
||||
|
||||
return matchesPort &&
|
||||
route.action.type === 'forward' &&
|
||||
route.action.tls &&
|
||||
(route.action.tls.mode === 'terminate' ||
|
||||
route.action.tls.mode === 'terminate-and-reencrypt');
|
||||
});
|
||||
const allowSessionTicket = hasTlsTermination;
|
||||
|
||||
// If no routes require TLS handling and it's not port 443, route immediately
|
||||
if (!needsTlsHandling && localPort !== 443) {
|
||||
// Extract underlying socket for socket-utils functions
|
||||
@@ -345,7 +359,7 @@ export class RouteConnectionHandler {
|
||||
record.lockedDomain = serverName;
|
||||
|
||||
// Check if we should reject connections without SNI
|
||||
if (!serverName && this.smartProxy.settings.allowSessionTicket === false) {
|
||||
if (!serverName && allowSessionTicket === false) {
|
||||
logger.log('warn', `No SNI detected in TLS ClientHello for connection ${record.id}; sending TLS alert`, {
|
||||
connectionId: record.id,
|
||||
component: 'route-handler'
|
||||
|
||||
Reference in New Issue
Block a user