tls: pauseOnConnect option not honored

Background

  • v12.10.0:
  • Darwin mcdouble 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64:
  • TLS

Issue

The fix in #27665 does not seem to work with the pauseOnConnect option. The test in that PR only checks the allowHalfOpen option. The docs indicate that Any net.createServer() option can be provided.

Reproduction

// Create self-signed cert at certificate.pem / key.pem

const assert = require('assert');
const fs = require('fs');
const { createServer } = require('tls');

const server = createServer({
  cert: fs.readFileSync('./certificate.pem'),
  key: fs.readFileSync('./key.pem'),
  pauseOnConnect: true,
}, socket => {
  assert(socket.isPaused(), 'Socket is not paused');
});

server.listen(6666);

Expect error 'Socket is not paused' when you ncat --ssl localhost 6666 or wget https://localhost:6666.