Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digest.auth_header throws: NoMethodError (undefined method `gsub' for nil:NilClass) #18

Open
rgaufman opened this issue Aug 9, 2018 · 1 comment

Comments

@rgaufman
Copy link

rgaufman commented Aug 9, 2018

This is an response['WWW-Authenticate'] from a Hikvision IP camera, when I try to generate an auth-header I get this:

> uri
=> #<URI::HTTP http://admin:password1@192.168.1.163/ISAPI/Event/notification/alertstream>
> WWWAuthenticate
=> ["Digest qop=\"auth\", realm=\"IP Camera(C2198)\", nonce=\"4e474d325a6a55335a474d364d57566d596a4a6b4d446b3d\", stale=\"FALSE\"", "Basic realm=\"IP Camera(C2198)\""]
> digest.auth_header(uri, WWWAuthenticate, 'GET')
Traceback (most recent call last):
        1: from (irb):37
NoMethodError (undefined method `gsub' for nil:NilClass)

Any ideas?

@blakeage
Copy link

blakeage commented Feb 6, 2020

I had the same problem and realized the server I was attempting to authenticate had authentication turned off. After turning it back on, the error went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants