mswjs / interceptors

Low-level network interception library.
https://npm.im/@mswjs/interceptors
MIT License
539 stars 123 forks source link

fix(MockHttpSocket): set tls socket properties on init #561

Closed mikicho closed 5 months ago

mikicho commented 5 months ago

It seems like Node.js set these properties on TLSSocket init, before the connect event (source).

With umocked https:

https.get('https://example.com')
  .on('socket', socket => {
    console.log(socket.authorized); // false
    console.log(socket.encrypted);  // true
  });