server x DTLS handshake failed (mediasoup-client-aiortc)

I’m have a working server and browser version to produce with, but I’m trying to get a nodejs application working for publishing. I’m getting an error right on the last step when I attempt to produce a track:

 mediasoup-client:aiortc:Channel request() [method:handler.setRemoteDescription, id:9] +3ms
  mediasoup-client:aiortc:Worker (stdout) worker: processRequest() [method:handler.setRemoteDescription] +5ms
  mediasoup-client:aiortc:Worker (stdout) Connection(2) Components {1} have no candidate pairs +0ms
  mediasoup-client:aiortc:Channel request succeeded [method:handler.setRemoteDescription, id:9] +2ms
  mediasoup-client:aiortc:Worker (stdout) controlling - new -> checking +2ms
  mediasoup-client:aiortc:Worker (stdout) controlling - checking -> failed +0ms
  mediasoup-client:aiortc:Worker (stdout) server - State.NEW -> State.CONNECTING +0ms
  mediasoup-client:aiortc:Worker (stdout) server x DTLS handshake failed (connection error) +0ms
  mediasoup-client:aiortc:Worker (stdout) server - State.CONNECTING -> State.FAILED +0ms
  mediasoup-client:aiortc:Worker (stdout) handler: signalingstatechange [state:stable] +0ms
  mediasoup-client:aiortc:Worker (stdout) handler: iceconnectionstatechange [state:failed] +0ms
  mediasoup-client:aiortc:Worker (stdout) handler: iceconnectionstatechange [state:failed] +0ms

Maybe it’s something to do with ssl? As far as I can tell I’m correctly getting/setting dtls parameters from the server (and the same method works in the browser). I have openssl 1.1 installed.

Thanks for any help.

Edit: Here is what I’m getting on the server side, so I’m really not sure why it’s failing:

mediasoup:WebRtcTransport connect() +123ms
  mediasoup:Channel request() [method:transport.connect, id:12] +36ms
  mediasoup:Channel request succeeded [method:transport.connect, id:12] +1ms
connectWebRtcTransport() transport connected [id:mySpecialRoom, transport.id:f5eda7a2-56dd-496b-ab2b-aa32d56c484b, transport.direction:recv
send response { action: 'connectWebRtcTransport' } 1611740993418
  mediasoup:Channel [pid:80030] RTC::IceServer::HandleTuple() | transition from state 'new' to 'connected' +18ms
  mediasoup:Channel [pid:80030] RTC::WebRtcTransport::OnIceServerSelectedTuple() | ICE selected tuple +0ms
  mediasoup:Channel [pid:80030] RTC::WebRtcTransport::OnIceServerConnected() | ICE connected +5ms
  mediasoup:Channel [pid:80030] RTC::WebRtcTransport::MayRunDtlsTransport() | running DTLS transport in local role 'server' +1ms
  mediasoup:Channel [pid:80030] RTC::WebRtcTransport::OnDtlsTransportConnecting() | DTLS connecting +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::Run() | running [role:server] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | DTLS handshake start +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'before SSL initialization'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | role: server, waiting:'before SSL initialization'] +1ms
  mediasoup:Channel [pid:80030] RTC::WebRtcTransport::OnIceServerSelectedTuple() | ICE selected tuple +142ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'before SSL initialization'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read client hello'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write server hello'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write certificate'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write key exchange'] +2ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write certificate request'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write server done'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | role: server, waiting:'SSLv3/TLS write server done'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write server done'] +1ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read client certificate'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read client key exchange'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read certificate verify'] +1ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read change cipher spec'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS read finished'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write change cipher spec'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | [role:server, action:'SSLv3/TLS write finished'] +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::OnSslInfo() | DTLS handshake done +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::CheckRemoteFingerprint() | valid remote fingerprint +0ms
  mediasoup:Channel [pid:80030] RTC::DtlsTransport::GetNegotiatedSrtpCryptoSuite() | chosen SRTP crypto suite: SRTP_AEAD_AES_256_GCM +16ms
  mediasoup:Channel [pid:80030] RTC::WebRtcTransport::OnDtlsTransportConnected() | DTLS connected +0ms
  mediasoup:Channel [pid:80030] RTC::IceServer::HandleTuple() | transition from state 'connected' to 'completed' +27ms
  mediasoup:Channel [pid:80030] RTC::WebRtcTransport::OnIceServerCompleted() | ICE completed +1ms

In the end I resolved simply by running the broadcaster from Linux… I’m not sure what’s preventing the same code from working on macOS, but for now this is fine since I’m intending to run it on Linux in the end anyway.

Thanks for this great package - really nice to be able to broadcast without the browser.