wget:服务器返回错误:HTTP/1.1 401 未经 BusyBox 授权

wget:服务器返回错误:HTTP/1.1 401 未经 BusyBox 授权

我知道 Axis 相机 API 特定问题应该在 axis 开发者社区论坛上提出,但该问题似乎对于 http web 访问来说是通用的,因此尝试在这里获得一些帮助

我将 Axis IP 摄像机连接到本地网络。我在通过 BusyBox(同一本地网络中的嵌入式板)的 wget/curl 命令访问相机 API 时遇到问题

当从窗口 cygwin 的 wget 命令通过其 API 访问相机时,它给了我有效的响应:

admin@LAPTOP /cygdrive/c/axis $ wget -O imageformat.txt 'http://root:[email protected]/axis-cgi/param.cgi?action=list&group=Properties.Image.Format'
    --2021-06-30 11:13:07--  http://root:*password*@192.168.0.90/axis-cgi/param.cgi?action=list&group=Properties.Image.Format
    Connecting to 192.168.0.90:80... connected.
    HTTP request sent, awaiting response... 401 Unauthorized
    Authentication selected: Digest realm="AXIS_ACCC8E6E45B0", nonce="XTNm1/7FBQA=2e3d1152262381d33e3cf6abe6c728db4921c928", algorithm=MD5, qop="auth"
    Reusing existing connection to 192.168.0.90:80.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/plain]
    Saving to: ‘imageformat.txt’
    
    imageformat.txt      [ <=>       ]      47  --.-KB/s    in 0s
    
    2021-06-30 11:13:07 (470 KB/s) - ‘imageformat.txt’ saved [47]

但是,当我尝试从 BusyBox shell 中的 wget/curl 命令实现相同的目标时,它失败并显示“错误:HTTP/1.1 401 未经授权”,我确信相机凭据(用户名/密码)是正确的(因为我能够访问相机从具有相同凭据的浏览器和 Windows cygwin shell):

root@admin:~# curl 'http://root:[email protected]/axis-cgi/param.cgi?action=list&group=Properties.Image.Format'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>

root@mainboard-sbs:~# wget -O imageformat.txt 'http://root:[email protected]/axis-cgi/param.cgi?action=list&group=Properties.Image.Format'
Connecting to 192.168.0.90 (192.168.0.90:80)
wget: server returned error: HTTP/1.1 401 Unauthorized

可能是什么问题?我是否缺少 busybox 的 wget 中的任何身份验证/证书参数?

Version on windows machine:
admin@LAPTOP /cygdrive/c/axis $ wget --version
GNU Wget 1.21.1 built on cygwin.

Version on busybox machine:
root@admin:~# wget
BusyBox v1.24.1 (2019-02-19 13:37:55 IST) multi-call binary.

答案1

所以我正在发布我自己的查询的答案,如果有一天它可以帮助别人......

busybox(v1.24.1) 附带的 wget(v1.18) 不是全功能 wget,它是通过最少的开关安装的,因此将 wget Recipe 更新到 v1.21.1 解决了该问题。

相关内容