Internal error in http2 with checkServerIdentity undefined

Version

v18.18.0

Platform

Linux 3eaa088c9827 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 GNU/Linux

Subsystem

http2

What steps will reproduce the bug?

It happened with:

  this.clientInt = connect('https://' + +this.hostname + ':' + this.port, {
      settings: {
        enableConnectProtocol: true
      },
      checkServerIdentity,
      localPort: this.localPort
    })

Important is that checkServerIdentity is undefined.

It says then:

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at new NodeError (node:internal/errors:405:5)
    at assert (node:internal/assert:14:11)
    at Object.connect (node:_tls_wrap:1684:3)
    at connect (node:internal/http2/core:3298:22)
    at Http2WebTransportClient.createTransport (file:///workspaces/webtransport/lib/http2/client.js:57:22)
    at HttpClient.transportIntSwitchToReliable (file:///workspaces/webtransport/lib/transport.js:129:35)
    at file:///workspaces/webtransport/lib/webtransport.js:70:18 {
  code: 'ERR_INTERNAL_ASSERTION'
}

and I am just filling it, since node.js asked me to.
I assume it can be easily worked around by not having checkServerIdentity in the object, when not used.

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

Ignore the setting

What do you see instead?

The trace above.

Additional information

No response