wget: サーバーからエラーが返されました: HTTP/1.1 401 BusyBox で許可されていません

wget: サーバーからエラーが返されました: HTTP/1.1 401 BusyBox で許可されていません

Axis Camera APIに関する質問は、axis開発者コミュニティフォーラムに連絡する必要があることを知っていますが、質問はhttp Webアクセスに関する一般的なようです。

Axis IPカメラをローカルネットワークに接続しました。 BusyBox(同じローカルネットワークに組み込まれているボード)でwget / curlコマンドを使用してカメラAPIにアクセスできません。

Windows 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シェルのwget / curlコマンドで同じ結果を取得しようとすると、「Error:HTTP / 1.1 401 Unauthorized」メッセージで失敗し、カメラの資格情報(ユーザー名/パスワード)が正しいと確信しています。同じ資格情報を使用して、ブラウザとWindows cygwinシェルからカメラにアクセスできます。

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に更新すると問題が解決します。

おすすめ記事