-
Notifications
You must be signed in to change notification settings - Fork 327
Closed
Milestone
Description
New report:
Http.rb does not currently support digest authentication out of the box, e.g. https://www.ietf.org/rfc/rfc2617.txt
It would be a really welcome addition as the current workaround (in comment 4) is pretty clunky.
Original text:
I'm on Ubuntu linux, using Ruby 2.4.2p198 and http 3.0.0
When I try to make a connection to a Dahua camera, I get this:
> HttpClient.basic_auth(user: 'admin', pass: 'admin').get('http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=General')
=> #<HTTP::Response/1.1 401 Unauthorized {"Www-Authenticate"=>"Digest realm=\"Login to 2L05ABCPAA00246\",qop=\"auth\",nonce=\"671353293\",opaque=\"f1f47336b1c3f6c079c49377096a6ed59f81806c\"", "Connection"=>"close", "Content-Length"=>"0"}>
>
> HttpClient.basic_auth(user: 'admin', pass: 'admin').get('http://admin:admin@192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=General')
=> #<HTTP::Response/1.1 401 Unauthorized {"Www-Authenticate"=>"Digest realm=\"Login to 2L05ABCPAA00246\",qop=\"auth\",nonce=\"2128627133\",opaque=\"f1f47336b1c3f6c079c49377096a6ed59f81806c\"", "Connection"=>"close", "Content-Length"=>"0"}>However, wget seems to work:
$ wget 'http://admin:admin@192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=General'
--2018-01-12 15:33:14-- http://admin:*password*@192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=General
Connecting to 192.168.1.108:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Digest realm="Login to 2L05ABCPAA00246",qop="auth",nonce="665254639",opaque="f1f47336b1c3f6c079c49377096a6ed59f81806c"
Connecting to 192.168.1.108:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 207 [text/plain]
Saving to: ‘configManager.cgi?action=getConfig&name=General’
configManager.cgi?action=getConfig&name=General 100%[============================================================================================================================>] 207 --.-KB/s in 0s
2018-01-12 15:33:14 (14.1 MB/s) - ‘configManager.cgi?action=getConfig&name=General’ saved [207/207]Any ideas what I'm doing wrong?
Reactions are currently unavailable