fix(connectionhandler): Delay socket termination in TLS session resumption handling to allow proper alert processing
This commit is contained in:
		| @@ -1,5 +1,11 @@ | |||||||
| # Changelog | # Changelog | ||||||
|  |  | ||||||
|  | ## 2025-03-17 - 4.1.15 - fix(connectionhandler) | ||||||
|  | Delay socket termination in TLS session resumption handling to allow proper alert processing | ||||||
|  |  | ||||||
|  | - Removed the immediate socket.end() call in finishConnection and moved it inside the setTimeout, ensuring that clients (especially Chrome) have additional time to process the TLS alert before connection termination | ||||||
|  | - This prevents premature socket closure on ClientHello without SNI when session tickets are disallowed | ||||||
|  |  | ||||||
| ## 2025-03-17 - 4.1.14 - fix(ConnectionHandler) | ## 2025-03-17 - 4.1.14 - fix(ConnectionHandler) | ||||||
| Use the correct TLS alert data and increase the delay before socket termination when session resumption without SNI is detected. | Use the correct TLS alert data and increase the delay before socket termination when session resumption without SNI is detected. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,6 +3,6 @@ | |||||||
|  */ |  */ | ||||||
| export const commitinfo = { | export const commitinfo = { | ||||||
|   name: '@push.rocks/smartproxy', |   name: '@push.rocks/smartproxy', | ||||||
|   version: '4.1.14', |   version: '4.1.15', | ||||||
|   description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.' |   description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.' | ||||||
| } | } | ||||||
|   | |||||||
| @@ -625,10 +625,10 @@ export class ConnectionHandler { | |||||||
|               const finishConnection = () => { |               const finishConnection = () => { | ||||||
|                 // Give Chrome more time to process the alert before closing |                 // Give Chrome more time to process the alert before closing | ||||||
|                 // We won't call destroy() at all - just end() and let the socket close naturally |                 // We won't call destroy() at all - just end() and let the socket close naturally | ||||||
|                 socket.end(); |  | ||||||
|                  |                  | ||||||
|                 // Log the cleanup but wait for natural closure |                 // Log the cleanup but wait for natural closure | ||||||
|                 setTimeout(() => { |                 setTimeout(() => { | ||||||
|  |                   socket.end(); | ||||||
|                   this.connectionManager.cleanupConnection(record, 'session_ticket_blocked_no_sni'); |                   this.connectionManager.cleanupConnection(record, 'session_ticket_blocked_no_sni'); | ||||||
|                 }, 5000); // Longer delay to let socket cleanup happen naturally |                 }, 5000); // Longer delay to let socket cleanup happen naturally | ||||||
|               }; |               }; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user