Skip to content

Commit

Permalink
fix: NodeJS 18 compat (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
cplepage authored Mar 2, 2023
1 parent d4d9ed2 commit 45050bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ios/lib/client/lockdownd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class LockdowndClient extends ServiceClient<LockdownProtocolClient> {
this.protocolClient.socket,
{
secureContext: tls.createSecureContext({
secureProtocol: 'TLSv1_method',
secureProtocol: 'TLSv1_2_method',
cert: pairRecord.RootCertificate,
key: pairRecord.RootPrivateKey,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/ios/lib/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class ClientManager {
const tlsOptions: tls.ConnectionOptions = {
rejectUnauthorized: false,
secureContext: tls.createSecureContext({
secureProtocol: 'TLSv1_method',
secureProtocol: 'TLSv1_2_method',
cert: this.pairRecord.RootCertificate,
key: this.pairRecord.RootPrivateKey,
}),
Expand Down
3 changes: 3 additions & 0 deletions src/ios/lib/protocol/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ export abstract class ProtocolClient<MessageType = any> {
}
},
);
this.socket.on('error', err => {
throw err;
});
this.socket.on('data', reader.onData);
this.writer.write(this.socket, msg);
});
Expand Down

0 comments on commit 45050bb

Please sign in to comment.