401 Unauthorized from Google’s public STUN server (stun.l.google.com:19302) during ICE gathering

45 views
Skip to first unread message

Mohamed Shakeek

unread,
Jun 19, 2025, 3:06:25 AM6/19/25
to discuss-webrtc
Hi,

Platform:    [e.g. Chrome 114 on macOS 12.5]
Library:     [e.g. Native WebRTC / React-Native-WebRTC v1.92.1]
STUN Server: stun:stun.l.google.com:19302


I’m seeing intermittent 401 Unauthorized errors from Google’s public STUN server during ICE gathering. It happens randomly sometimes on one Wi-Fi network it works fine, then on another Wi-Fi or when peers connect via mobile hotspot it immediately fails with a 401.
  
Setup:  
const pc = new RTCPeerConnection({
  iceServers: [
    { urls: "stun:stun.l.google.com:19302" }
  ]
});


But when ICE gathering starts, the STUN binding request returns 401 Unauthorized, and no candidates come back. I’ve confirmed that:

  • I’m not sending any username or credential fields.

  • No TURN credentials are configured.

  • This STUN URL previously worked without authentication.

Reproduction Steps:

  1. Create RTCPeerConnection with the above ICE config

  2. Call pc.createOffer() → pc.setLocalDescription()

  3. In the browser console or packet capture, the STUN request to stun.l.google.com:19302 responds with 401.

    const configuration = {
        iceServers: [
          { urls: "stun:stun.l.google.com:19302" },
          { urls: "stun:stun1.l.google.com:19302" },

          // Other public STUNs
          { urls: "stun:stun.ekiga.net" },
          { urls: "stun:stun.sipgate.net" },
        ],
      };


Expected:
A normal Binding Success Response (no authentication challenge), and ICE candidates populated.  

Actual:
STUN_BINDING_ERROR, 401 Unauthorized challenge, ICE gathering stalls.  

Questions for the community / Google team:

  1. Has Google recently enabled authentication on its public STUN endpoint?

  2. If so, what credentials (username/password or token) should clients use?

  3. If not, is this a temporary outage or misconfiguration?

  4. Are there any alternative Google-hosted STUN endpoints we can use in the meantime?

Reply all
Reply to author
Forward
0 new messages