473,503 Members | 1,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Certificate 403 web response

I am baffled, I have a web service doing a ssl connection to a website using
ssl and a certificate that came to me in a p12 format. This code worked
100% in vb.net app but fails to work in service. I keep getting 403
forbidden error when the response like is executed. I have the following
code

strInquiryData = New Uri("https://someite:308")
' Build the inquiry string
sPostData = TransConnect
' Dim wreqTU40 As HttpWebRequest =
CType(WebRequest.Create(strInquiryData), HttpWebRequest)

wreqTU40.Method = "POST"
wreqTU40.ContentType = "application/x-www-form-urlencoded"

Dim Certificate As String
Certificate = "C:\certs\TA.cer"
Dim cert As X509Certificate =
X509Certificate.CreateFromCertFile(Certificate)

wrreqTU40.ClientCertificates.Add(cert)

Dim strInquiry As System.IO.Stream = wreqTU40.GetRequestStream
'Convert the Post Data to a byte array

Dim baPostData As Byte() = System.Text.Encoding.ASCII.GetBytes(sPostData)
strInquiry.Write(baPostData, 0, sPostData.Length)

'Write the Post Data to the request stream
strInquiry.Close()
Dim wresResponse As HttpWebResponse

wresResponse = CType(wreqTU40.GetResponse(),
HttpWebResponse) ‘error happens here

It crashes at the web response area every time with 403 error, what gives? I
have checked the certificate, reinstalled it like 5 times with key and
exported it as der form. I have no other ideas. Does anyone else have one?
Thanks,
Joe

Nov 23 '05 #1
0 1331

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
8656
by: Johan Delimon | last post by:
Hello, I have created an ASP page that requests special V2.0 Certificates for a user. This is to use with our VPN solution. My code errors on this line: requeststr =...
0
1104
by: Will | last post by:
It seems that I have scoured the net and came up empty handed. I have an ASP.net app that posts xml to another company's servlet. For some transactions, they do not require a certificate, but...
1
4643
by: Marvin | last post by:
my asp.net app is posting to another webpage using httpwebRequest & x509Certificates and in return the certificate's name used for the posting is sent back. But instead of getting information about...
4
2169
by: =?Utf-8?B?SGVyYg==?= | last post by:
For some reason my application now requires that I "Sign the ClickOnce manifests". I don't know that it ever has before. I clicked the "Create Test Certificate" and after a reinstall everything is...
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7072
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.