I have problems trying to use custom basic authentication module similar to this. The client uses HttpWebRequest class.
HttpWebRequest
The client runs the following code:<
What are the http status codes returned from the server? Is the certificate of the server valid? Can you post the stack trace?
Try to disable your firewall and other networking tools like fiddler etc on your client. Also try with the KeepAlive property to false.