By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,928 Members | 1,200 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,928 IT Pros & Developers. It's quick & easy.

https authentification

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.

"Greg Hill" <so*****@microsoft.com> wrote in message
news:40********@usenet01.boi.hp.com...
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

Nov 20 '05 #2

P: n/a
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
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.