Custom WebDAV server does not work with Windows 7 mini-redirector

若如初见. 提交于 2019-12-11 14:38:40

问题


I am maintaining a custom WebDav server, which works smoothly with most WebDav clients such as Cadaver, Mac OSX, etc, but does not work with Windows mini-redirector, i.e. net drive in Windows Explorer.

The server implemented Digest authentication.

The symptom is: I was always prompted for entering username and password even after I entered correct credentials. Even more weird thing is, when I am using Fiddler, the problem is gone.

I have looked into several possibilities: 1. persistent connection issue, but my apache server enabled digest and webdav works smoothly with win 7 client. 2. default namespace issue. https://issues.apache.org/bugzilla/show_bug.cgi?id=49428, but my server does not have this problem neither.

Could you please give me some hints on this ? Thank you


回答1:


This turned out to be a connection issue. The root cause was that win7 mini-redirector DOES NOT send cached "Authorization" header when previous connection was dropped.

The usual handshake of Digest is like this:

  1. client starts a connection C, send request R
  2. server response with a 401, send back through connection C, drop it or not, it depends
  3. client get the 401, compute an "Authorization" header
  4. if C does not exist anymore, start another connection C', and send another request R' including the header through C', or if C is still alive, send R' through C.
  5. server authenticates the request, return 200 if credentials are correct.

The problem with win7 dav client is at step 4. above, because my server will drop the connection C in step 2, so in step 4, win 7 will NOT send R', which includes the "Authorization header", it will start over to create a new connection C', send plain request R again!

Hence the user will observe this weird "I entered username and password correctly but it always asks me again" error.

Please refer to my blog for further details: http://dark9t.github.io/blog/2014/06/02/why-digest-authentication-fails-in-windows-7-mini-redirector/



来源:https://stackoverflow.com/questions/23926497/custom-webdav-server-does-not-work-with-windows-7-mini-redirector

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!