Skip to content

Commit 45050bb

Browse files
authored
fix: NodeJS 18 compat (#275)
1 parent d4d9ed2 commit 45050bb

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/ios/lib/client/lockdownd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class LockdowndClient extends ServiceClient<LockdownProtocolClient> {
139139
this.protocolClient.socket,
140140
{
141141
secureContext: tls.createSecureContext({
142-
secureProtocol: 'TLSv1_method',
142+
secureProtocol: 'TLSv1_2_method',
143143
cert: pairRecord.RootCertificate,
144144
key: pairRecord.RootPrivateKey,
145145
}),

src/ios/lib/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class ClientManager {
110110
const tlsOptions: tls.ConnectionOptions = {
111111
rejectUnauthorized: false,
112112
secureContext: tls.createSecureContext({
113-
secureProtocol: 'TLSv1_method',
113+
secureProtocol: 'TLSv1_2_method',
114114
cert: this.pairRecord.RootCertificate,
115115
key: this.pairRecord.RootPrivateKey,
116116
}),

src/ios/lib/protocol/protocol.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ export abstract class ProtocolClient<MessageType = any> {
127127
}
128128
},
129129
);
130+
this.socket.on('error', err => {
131+
throw err;
132+
});
130133
this.socket.on('data', reader.onData);
131134
this.writer.write(this.socket, msg);
132135
});

0 commit comments

Comments
 (0)