From b32690c6b154f20515fe7f7d4a7f06575701dd26 Mon Sep 17 00:00:00 2001 From: Kevin Leung Date: Tue, 14 Jul 2026 20:33:34 +1000 Subject: [PATCH] Wire TLSSocket X509Certificate return types to crypto.X509Certificate. Replace Any stubs and section-3 TODOs now that the crypto audit lands the shared type. Co-authored-by: Cursor --- src/js/node/tls/TLSSocket.hx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/js/node/tls/TLSSocket.hx b/src/js/node/tls/TLSSocket.hx index 26bcfd5c..8bff6838 100644 --- a/src/js/node/tls/TLSSocket.hx +++ b/src/js/node/tls/TLSSocket.hx @@ -24,12 +24,13 @@ package js.node.tls; import haxe.Constraints.Function; import haxe.extern.EitherType; +import js.lib.Error; import js.node.Buffer; import js.node.Tls.TlsClientOptionsBase; import js.node.Tls.TlsServerOptionsBase; +import js.node.crypto.X509Certificate; import js.node.events.EventEmitter.Event; import js.node.tls.SecureContext.SecureContextOptions; -import js.lib.Error; /** Enumeration of events emitted by `TLSSocket` objects in addition to its parent class events. @@ -203,16 +204,16 @@ extern class TLSSocket extends js.node.net.Socket { /** Returns the peer certificate as an `X509Certificate` object. - // TODO(section-3): type against crypto.X509Certificate once crypto audit exposes it + If there is no peer certificate, or the socket has been destroyed, `null` is returned. **/ - function getPeerX509Certificate():Any; + function getPeerX509Certificate():Null; /** Returns the local certificate as an `X509Certificate` object. - // TODO(section-3): type against crypto.X509Certificate once crypto audit exposes it + If there is no local certificate, or the socket has been destroyed, `null` is returned. **/ - function getX509Certificate():Any; + function getX509Certificate():Null; /** Initiate TLS renegotiation process.