System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a sen

S

Steven Harris

Hi.

I've read several posts on this and the general consensus seems to be
if you override the GetWebRequest and set .KeepAlive = False it cures
the problem.

This worked well BUT after-setting this I was unable to get proxy
authentication working, always getting a 407 Proxy Authentication
required.

I have tried several ways of getting through the proxy i.e.

1. g_PROXY.Credentials = New Net.NetworkCredential(txtUsername.Text,
txtPassword.Text, txtDomain.Text)

2. 'Dim netCred As New System.Net.NetworkCredential
'netCred.UserName = txtUsername.Text
'netCred.Password = txtPassword.Text
'netCred.Domain = txtDomain.Text

'Dim objCredentials As New System.Net.CredentialCache
'objCredentials.Add(New Uri(g_WEBREF.Url), "NTLM", netCred)
'objCredentials.Add(New Uri(g_WEBREF.Url), "BASIC", netCred)
'g_PROXY.Credentials = objCredentials

So to sum it up, If I dont override the GetWebRequest and leave
".KeepAlive = True" then
it all works fine, with and without supplying crudentials (username,
password, domain).

Can anyone tell me why setting .KeepAlive = False cause proxy
authentication problems???

Many Thanks
Steve.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top