|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Re: NTLM usrname/password failure after each 5 minsAfter investigating some more on the issue, I've found out that the
load test problem is not in the synchronize issue I've raised, but its
in the hiccup you've described.
The Hiccup as I've seen it The transport is not being used for 5 minutes, since the load test is using the same users, thus jCIFS is using the cache. Once the transport performs the disconnect and then the connect, the transport.server.encryptionKey changes. Since the encryptionKey is the challenge jCIFS returns to the browser on the type2 message, it is the heart of the problem. The problem occurs when we send the challenge, before the disconnect ,in the type2 message. While the browser is processing and preparing the type3 message using that challenge (let's call it A), the disconnect/connect occurs and we have a new encryption key / challenge we're using when we communicate with the DC (Let's call this challenge B). After the connect completes, we receive the type3 message which was prepared using challenge A, and send it to the DC, while he expects us to use challenge B. That's why we get the "bad username or password" exception. Trying to solve it I can detect in the NtlmFilter, this situation, if I save the challenge, used in the type2 message, on the session, and compare it with the challenge currently being used in the transport, before processing the type 3 message. I've tried sending a 401 with WWW-Authenticate: NTLM, to restart the process, this time with right challenge, but it didn't work. I've also tried sendind a redirect (301) to the same resource, to restart the NTLM, but it fails with a circular redirect. If the load test is using a small number of threads, then the problem doesn't happen, since the time between the type3 message is processed quick enough, before we the disconnect occurs. If we load it with many threads, it always happens. Guidance is needed 1. Can we some how know how much time the socket have before reaching timeout? If we did, maybe we could use it when we prepare type2 message. If we're too close to the disconnect, then we'll force it, or wait until it happens and then send in the type2 message. 2. What's the implications of keeping it open indefenitely? Or just "keeping it alive" somehow? 3. Do you have any idea on how to handle this issue? Thank you, Asaf On Mon, Jun 16, 2008 at 1:00 AM, Michael B Allen <ioplex@...> wrote:
|
|
|
Re: NTLM usrname/password failure after each 5 minsOn 6/24/08, Asaf Mesika <asaf.mesika@...> wrote:
> After investigating some more on the issue, I've found out that the load > test problem is not in the synchronize issue I've raised, but its in the > hiccup you've described. > > The Hiccup as I've seen it > The transport is not being used for 5 minutes, since the load test is using > the same users, thus jCIFS is using the cache. Once the transport performs > the disconnect and then the connect, the transport.server.encryptionKey > changes. Since the encryptionKey is the challenge jCIFS returns to the > browser on the type2 message, it is the heart of the problem. > The problem occurs when we send the challenge, before the disconnect ,in > the type2 message. Aha. Interesting. Nice work! Unfortunately this is a little difficult to fix because there is no way to know if or when the HTTP client will submit hashes that use that challenge. The HTTP client could get the challenge, sleep for an hour, and then submit the type-3-message. Or it could get the challenge and never submit hashes at all. There's no way to handle both of those cases gracefully. It's just a limitation in trying to do stateful authentication over a stateless protocol. However, in practice there are idle periods where no clients are authenticating and it is safe to disconnect the client and thereby free associated resources. We just need to >>stop the transport from disconnecting as long as there are outstanding challenges<<. To implement this, add a "refcount" to jcifs.util.transport.Transport. In loop(), detect the soTimeout case (I don't recall what type of Exception this triggers) and do NOT call disconnect() if refcount > 0. Then, in SmbSession.interrogate(), change trans.server.encryptionKey to trans.getEncryptionKey() and in SmbTransport.getEncryptionKey(), increment trans.refcount++. Also, in SmbSession.logon(), decrement trans.refcount-- if it is > 0 after the challenge is used. However, this will result in a net positive refcount value because clients may not send the type-3-message and, again, in general there are many things that can go wrong that prevent logon from ever being called. So, you also need to decrement trans.refcount in another more aggressive way. For example, you could decrement the refcount every time you get the exception triggered by soTimeout but do not disconnect. Meaning refcount will be decremented every time soTimeout fires. That could be enough to offset any misbehaving clients. You might also cap the refcount value at some high value that would almost never be reached with HTTP clients that are behaving properly. I'm just brainstorming at this point but basically you need to stop the transport from disconnecting if there are outstanding challenges. How you detect when there are outstanding challenges and when they should no longer be counted is up to you. Mike -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ |
|
|
Re: NTLM usrname/password failure after each 5 minsI ran into this same problem a few years ago. I implemented a refcount as described and it helped prevent this type of issue. I think I've still got the modified code laying around somewhere. If it helps, I could dig it up and provide a diff of the changes.
http://article.gmane.org/gmane.network.samba.java/4372/match=nt%5fstatus%5faccess%5fviolation
On Tue, Jun 24, 2008 at 1:17 PM, Michael B Allen <ioplex@...> wrote:
-- Kevin Tapperson kevin@... (615) 403-0817 |
|
|
Re: NTLM usrname/password failure after each 5 minsWe have noticed something similar but a slight different. We have pre-authentication enabled. When the first user connects, the user is authenticated fine. If a second user connects after the first user this user is not able to authenticate until the session of the first user has timed out (after 5 minutes). We are using the latest JCIFS version with Apache/Tomcat 5.5 on a W2k3 server. Any ideas? |
|
|
Re: NTLM usrname/password failure after each 5 mins>
> Actually accessing IPC$ is normal. I don't know what I was thinking > before. I don't know what the problem is. > > Although I think the jcifs.smb.client.dfs.disabled property was added in 1.2.22. > > Mike Did you ever get any insight to this? I'm now running into this consistently. I'll post a test case later but thought I'd first ask. |
| < Prev | 1 - 2 | Next > |
| Free Forum Powered by Nabble | Forum Help |