Welcome to the "trac"-ing site of http-access2!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #31 (closed defect: fixed)

Opened 3 years ago

Last modified 1 year ago

fixed the problem of always sending the password in the clear by checking the HTTP and making sure that the server is indeed requesting basic realm

Reported by: nahi Assigned to: nahi
Priority: high Milestone: 2.0.8
Component: core Version: 2.0
Keywords: Cc:

Description (Last modified by nahi)

(from soap4r ML)

I fixed the problem of always sending the password in the clear by
checking the HTTP and making sure that the server is indeed requesting
basic realm.  In class BasicAuth I added lines with +:

def set(uri, user_id, passwd)
    uri = uri.clone

+    # Make sure that the server is really requesting Basic
Authentication!
+    serverRealm = (@client.head(uri).header['WWW-Authenticate']).join
+    return nil if ("Basic realm".downcase !=
serverRealm[0,11].downcase)

    uri.path = uri.path.sub(/\/[^\/]*$/, '/')
    @auth[uri] = ["#{user_id}:#{passwd}"].pack('m').strip
    @client.reset_all
  end

I forgot to mention that the digest authentication in the code I posted
earlier is hardcoded to build the digest response with "POST" which
always works for me, as I'm sending SOAP.  I'm not sure how to get the
correct HTTP method.  (http-access2 is about 1700 lines of code and I
haven't had a chance to understand the flow . . . )

NaHi?: I think I understood the problem but the problem is in BasicAuth#get?, not in BasicAuth#set?, right? http-access2 now sends password to a defined realm even if WWW-Authenticate is missing.

Change History

02/05/06 18:51:58 changed by nahi

  • description changed.

05/28/07 12:07:56 changed by nahi

  • milestone changed from undefined to 2.0.8.

06/22/07 00:11:32 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

(In [151]) * implemented request/response filter interface.