Java Android WebRTC无法连接到coTURN服务器:错误401:未经授权

Java Android WebRTC无法连接到coTURN服务器:错误401:未经授权,java,android,webrtc,turn,coturn,Java,Android,Webrtc,Turn,Coturn,我已经用lt cred mech选项设置了一个服务器(使用TURN REST API)。我生成的用户看起来像: 用户:1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4 通过:doSnY8s16/vK6ynnALMkbl0DcLo= 我已通过测试,并且我的浏览器可以连接到我的服务器: 来自coTURN服务器的日志: 240848: session 001000000000000929: realm <> user <>:

我已经用
lt cred mech
选项设置了一个服务器(使用TURN REST API)。我生成的用户看起来像:

  • 用户:
    1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4
  • 通过:
    doSnY8s16/vK6ynnALMkbl0DcLo=
我已通过测试,并且我的浏览器可以连接到我的服务器:

来自coTURN服务器的日志:

240848: session 001000000000000929: realm <> user <>: incoming packet BINDING processed, success
240849: session 001000000000000928: realm <> user <>: incoming packet BINDING processed, success
240851: IPv4. Local relay addr: 172.30.0.9:49063
240851: session 000000000000000589: new, realm=<>, username=<1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>, lifetime=3600
240851: session 000000000000000589: realm <> user <1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>: incoming packet ALLOCATE processed, success
240851: IPv4. Local relay addr: 172.30.0.9:49021
240851: session 000000000000000590: new, realm=<>, username=<1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>, lifetime=3600
240851: session 000000000000000590: realm <> user <1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>: incoming packet ALLOCATE processed, success
240851: session 000000000000000589: refreshed, realm=<>, username=<1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>, lifetime=0
240851: session 000000000000000589: realm <> user <1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>: incoming packet REFRESH processed, success
240851: session 000000000000000589: TCP socket closed remotely x.x.x.x:44301
240851: session 000000000000000589: usage: realm=<>, username=<1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>, rp=3, rb=324, sp=3, sb=312
240851: session 000000000000000589: peer usage: realm=<>, username=<1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>, rp=0, rb=0, sp=0, sb=0
240851: session 000000000000000589: closed (2nd stage), user <1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4> realm <> origin <>, local 172.30.0.9:3478, remote x.x.x.x:44301, reason: TCP connection closed by client (callback)
240851: session 000000000000000589: delete: realm=<>, username=<1601871288:4e4d54c1-7b69-40a2-b355-ff2b40e003c4>
但我从服务器收到错误:
错误401:未经授权

从服务器登录:

241236: session 001000000000000943: realm <> user <>: incoming packet message processed, error 401: Unauthorized
241236: session 001000000000000944: realm <> user <>: incoming packet message processed, error 401: Unauthorized
241236: session 001000000000000943: realm <> user <>: incoming packet message processed, error 401: Unauthorized
241236: session 000000000000000591: realm <> user <>: incoming packet message processed, error 401: Unauthorized
241236: session 001000000000000944: realm <> user <>: incoming packet message processed, error 401: Unauthorized
241236:会话001000000000000943:域用户:已处理传入数据包消息,错误401:未经授权
241236:会话001000000000000944:领域用户:已处理传入数据包消息,错误401:未经授权
241236:会话001000000000000943:领域用户:已处理传入数据包消息,错误401:未经授权
241236:会话000000000000000 591:领域用户:已处理传入数据包消息,错误401:未经授权
241236:会话001000000000000944:领域用户:已处理传入数据包消息,错误401:未经授权
有人能告诉我哪里出了错吗


提前感谢。

也许这会帮助你找到一些线索,基本上是你的晕眩/转身服务器没有验证你的候选人。 摘自:

   If the response is an error response with an error code of 401
   (Unauthenticated), the client SHOULD retry the request with a new
   transaction.  This request MUST contain a USERNAME or a USERHASH,
   determined by the client as the appropriate username for the REALM
   from the error response.  If the "nonce cookie" is present and has
   the STUN Security Feature "Username anonymity" bit set to 1, then the
   USERHASH attribute MUST be used; else, the USERNAME attribute MUST be
   used.  The request MUST contain the REALM, copied from the error
   response.  The request MUST contain the NONCE, copied from the error
   response.  If the response contains a PASSWORD-ALGORITHMS attribute,
   the request MUST contain the PASSWORD-ALGORITHMS attribute with the
   same content.  If the response contains a PASSWORD-ALGORITHMS
   attribute, and this attribute contains at least one algorithm that is
   supported by the client, then the request MUST contain a PASSWORD-
   ALGORITHM attribute with the first algorithm supported on the list.
   If the response contains a PASSWORD-ALGORITHMS attribute, and this
   attribute does not contain any algorithm that is supported by the
   client, then the client MUST NOT retry the request with a new
   transaction.  The client MUST NOT perform this retry if it is not
   changing the USERNAME, USERHASH, REALM, or its associated password
   from the previous attempt.