fix(classes.pp.connectionhandler): Replace unrecognized_name alert data with certificate_expired alert in TLS handshake handling for session resumption without SNI

This commit is contained in:
2025-03-17 13:09:54 +00:00
parent 7797c799dd
commit e126032b61
3 changed files with 19 additions and 2 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartproxy',
version: '4.1.11',
version: '4.1.12',
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.'
}

View File

@ -605,10 +605,20 @@ export class ConnectionHandler {
0x00, // close_notify alert (0)
]);
const certificateExpiredAlert = Buffer.from([
0x15, // Alert record type
0x03,
0x03, // TLS 1.2 version
0x00,
0x02, // Length
0x02, // Fatal alert level (2)
0x2F, // certificate_expired alert (47)
]);
try {
// Use cork/uncork to ensure the alert is sent as a single packet
socket.cork();
const writeSuccessful = socket.write(serverNameUnknownAlertData);
const writeSuccessful = socket.write(certificateExpiredAlert);
socket.uncork();
// Function to handle the clean socket termination - but more gradually