Skip to content

Commit 0f66399

Browse files
authored
TLS: Only use the server_name extension during server hello (#62)
PHP 8.4 drops support for many TLS extensions advertised by our TLS proxy. Only the server_name extension seems to be supported (and required). This PR drops the other extensions. Turns out TLS proxy still works without them all the way down to PHP 7.2. ## Testing instructions Confirm the E2E tests still pass, especially the ones related to networking and testing the plugins directory in wp-admin.
1 parent 75914a5 commit 0f66399

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

packages/php-wasm/web/src/lib/tls/1_2/connection.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { ServerNameExtension } from '../extensions/0_server_name';
22
import { CipherSuitesNames } from '../cipher-suites';
33
import { CipherSuites } from '../cipher-suites';
4-
import { SupportedGroupsExtension } from '../extensions/10_supported_groups';
5-
import { ECPointFormatsExtension } from '../extensions/11_ec_point_formats';
64
import { parseClientHelloExtensions } from '../extensions/parse-extensions';
75
import {
86
ArrayBufferReader,
@@ -14,7 +12,6 @@ import {
1412
import {
1513
HashAlgorithms,
1614
SignatureAlgorithms,
17-
SignatureAlgorithmsExtension,
1815
} from '../extensions/13_signature_algorithms';
1916
import { tls12Prf } from './prf';
2017
import {
@@ -1171,19 +1168,6 @@ class MessageEncoder {
11711168
* Source: dfile:///Users/cloudnik/Library/Application%20Support/Dash/User%20Contributed/RFCs/RFCs.docset/Contents/Resources/Documents/rfc6066.html#section-3
11721169
*/
11731170
return ServerNameExtension.encodeForClient();
1174-
case 'supported_groups':
1175-
return SupportedGroupsExtension.encodeForClient(
1176-
'secp256r1'
1177-
);
1178-
case 'ec_point_formats':
1179-
return ECPointFormatsExtension.encodeForClient(
1180-
'uncompressed'
1181-
);
1182-
case 'signature_algorithms':
1183-
return SignatureAlgorithmsExtension.encodeforClient(
1184-
'sha256',
1185-
'rsa'
1186-
);
11871171
}
11881172
return undefined;
11891173
})

packages/php-wasm/web/src/lib/tls/extensions/13_signature_algorithms.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export class SignatureAlgorithmsExtension {
7676
const hash = reader.readUint8();
7777
const algorithm = reader.readUint8();
7878
if (!SignatureAlgorithmsNames[algorithm]) {
79-
logger.warn(`Unknown signature algorithm: ${algorithm}`);
79+
// Unknown signature algorithm. It's fine, the client just supports
80+
// more algorithms than the server.
8081
continue;
8182
}
8283
if (!HashAlgorithmsNames[hash]) {

0 commit comments

Comments
 (0)