https authentification

  • Thread starter Thread starter Greg Hill
  • Start date Start date
G

Greg Hill

Hi
I'm trying to access a web server that requires authentification for a https
page. I can access http pages on that server but get "(401) Authentification
Error" for the https page. I have a login for that page but don't know where
my code is wrong. Any hints will be appreciated.

TIA Greg

Code:

Dim sClUri As String = ClientPage.Text ' https Address
System.Net.ServicePointManager.CertificatePolicy = New MyPolicy
'Certificate
Dim ClientUri As System.Uri = New System.Uri(sClUri) 'Address into
Uri
Dim ClientRequest As HttpWebRequest = WebRequest.Create(ClientUri)
'gerenate request
Dim ClientCred As NetworkCredential = New
NetworkCredential(username.Text, userPassword.Text, userDomain.Text) 'adding
login data to request
Dim ClientCredCache As CredentialCache = New CredentialCache
ClientCredCache.Add(ClientUri, "Basic", ClientCred)
ClientRequest.Credentials = ClientCredCache
'ClientRequest.Credentials = CredentialCache.DefaultCredentials
ClientRequest.KeepAlive = False
ClientRequest.Timeout = 300000
ClientRequest.Method = "GET"
'sending request and getting response
Dim ClientResponse As HttpWebResponse
Try
ClientResponse = ClientRequest.GetResponse()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error accessing
Client Inventory data")
'Exit Sub
End Try
 
Greg,
make sure first that you are using internet explorer version 5.5 or higher.
That very often is a problem for our customers at work, when they simply
can't get in to https.
I recommend upgrading to version 5.5 or later. If you do not meet the above
minimum requirements, you will not be able to sign into 128bit encryption
sites.
k.
 
K,

I have no problem accessing the page in my browser. So it seems to me that I
don't send the server suthentication in the right way.

Greg
 

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

Back
Top