473,785 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpWebRequest encryption?

Hi there,

Can anyone tell me what level of encryption is used when making an HTTPS
POST request through an instance of the System.Net.Http WebRequest object?

Thanks much in advance!

Mike Cronin
Data On Call - Programmer

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #1
9 8188
what ever the server supports, not all servers support 128bit
"Mike Cronin via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:91******** *************** *******@DotNetM onster.com...
Hi there,

Can anyone tell me what level of encryption is used when making an HTTPS
POST request through an instance of the System.Net.Http WebRequest object?

Thanks much in advance!

Mike Cronin
Data On Call - Programmer

--
Message posted via http://www.dotnetmonster.com

Jul 21 '05 #2
That is defined by the server certificate. For your specific site, take a
look at the cert and you can see the level of encryption that will be used.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Mike Cronin via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:91******** *************** *******@DotNetM onster.com...
Hi there,

Can anyone tell me what level of encryption is used when making an HTTPS
POST request through an instance of the System.Net.Http WebRequest object?

Thanks much in advance!

Mike Cronin
Data On Call - Programmer

--
Message posted via http://www.dotnetmonster.com

Jul 21 '05 #3
Thanks for your reply Nick!

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #4
Thanks for your reply Alvin!

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #5
If a 128-bit encrypted client sends an HTTPS POST request to a server that
handles 128-bit encryption, does the client need to do anything more than
what follows...

String url = "https://securesite.com? user=xxx&passwo rd=yyy";
HttpWebRequest webRequest = (HttpWebRequest )WebRequest.Cre ate(url);
webRequest.set_ ContentType("ap plication/x-www-form-urlencoded");
webRequest.set_ ContentLength(q uery.length());
webRequest.set_ Method("POST");
StreamWriter sw = new StreamWriter(we bRequest.GetReq uestStream());
sw.Write(query. ToString());
sw.Close();

Under the circumstances mentioned, will this simple request produce a 128-
bit encrypted POST?

Is there no need to use System.Security .Cryptography.X 509Certificates ?

I just need to be clear on the level of encryption.

Any assistance is most appreciated!

Mike Cronin

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #6
You have some pretty confused code there.

The set_ContentType method is a method of the page object, used only on the
server side.
In addition, it is a method used internally by .NET and is not intended to
be used from your code.

Considering the fact that you are creating an HttpWebRequest object, the
set_ContentType method doesn't apply.

My guess is that you posted this snippet after it failed to compile...
correct?

A good example of the code you need can be found here
http://msdn.microsoft.com/library/en...engthtopic.asp

And, yes, posting to an HTTPS URL will have the effect of encrypting the
data in-stream. You do not need to use any encryption APIs.
Try it for yourself. Sniff the port. (If you don't have a sniffer, you may
want to try Ethereal or one of the other sniffing utilities that uses
WinPCap to sniff your ports.)

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Mike Cronin via DotNetMonster.c om" <fo***@DotNetMo nster.com> wrote in
message news:a1******** *************** *******@DotNetM onster.com...
If a 128-bit encrypted client sends an HTTPS POST request to a server that
handles 128-bit encryption, does the client need to do anything more than
what follows...

String url = "https://securesite.com? user=xxx&passwo rd=yyy";
HttpWebRequest webRequest = (HttpWebRequest )WebRequest.Cre ate(url);
webRequest.set_ ContentType("ap plication/x-www-form-urlencoded");
webRequest.set_ ContentLength(q uery.length());
webRequest.set_ Method("POST");
StreamWriter sw = new StreamWriter(we bRequest.GetReq uestStream());
sw.Write(query. ToString());
sw.Close();

Under the circumstances mentioned, will this simple request produce a 128-
bit encrypted POST?

Is there no need to use System.Security .Cryptography.X 509Certificates ?

I just need to be clear on the level of encryption.

Any assistance is most appreciated!

Mike Cronin

--
Message posted via http://www.dotnetmonster.com

Jul 21 '05 #7
Nope the actual code compiles fine and is used to POST requests to us.

I should have told you that I am working in J#. Using J#, I have a
set_ContentType () not ContentType() method exposed. Sorry about the
confusion.

One other thing, the logic did get a bit tweaked when I modified the
snippet for posting. The following reflects more accurately what is coded
(the URL and query string are separated)...

String url = "https://securesite.com" ;
String query = "user=xxx&passw ord=yyy";
HttpWebRequest webRequest = (HttpWebRequest )WebRequest.Cre ate(url);
webRequest.set_ ContentType("ap plication/x-www-form-urlencoded");
webRequest.set_ ContentLength(q uery.length());
webRequest.set_ Method("POST");
StreamWriter sw = new StreamWriter(we bRequest.GetReq uestStream());
sw.Write(query. ToString());
sw.Close();

Nevertheless, I just wanted to make sure that in the circumstance
previously described the resulting post would be 128-bit encrypted (one of
our clients needs to be certain their data is 128-bit encrypted).

You are awesome for helping out bud!

Thanks for your quick reply!

Mike Cronin

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #8
I am using the following code to post data to the site on Domino server but
always
gives the following error at this line
Dim streamWriter = New
System.IO.Strea mWriter(httpWeb Request.GetRequ estStream())

"Operation Timed OUT"
or
"Underlying Connection is Closed.."

I have used the following code :

Dim stringPost = "Username=xxx&P assword=yyy"

Dim httpWebRequest As System.Net.Http WebRequest =
System.Net.Http WebRequest.Crea te("https://corpmis.ggn.hcl tech.com//names.nsf?Login ")
httpWebRequest. ContentType = "applicatio n/x-www-form-urlencoded"
httpWebRequest. ContentLength = stringPost.Leng th
httpWebRequest. Method = "POST"

Dim streamWriter = New
System.IO.Strea mWriter(httpWeb Request.GetRequ estStream())
streamWriter.Wr ite(stringPost)
streamWriter.Cl ose()

Dim httpWebResponse As System.Net.Http WebResponse =
httpWebRequest. GetResponse()
Dim streamReader = New
System.IO.Strea mReader(httpWeb Response.GetRes ponseStream())
Dim stringResult = streamReader.Re adToEnd()
streamReader.Cl ose()
Please Help!!!!!

Thanks & Regards,
Neeraj

"Mike Cronin via DotNetMonster.c om" wrote:
Nope the actual code compiles fine and is used to POST requests to us.

I should have told you that I am working in J#. Using J#, I have a
set_ContentType () not ContentType() method exposed. Sorry about the
confusion.

One other thing, the logic did get a bit tweaked when I modified the
snippet for posting. The following reflects more accurately what is coded
(the URL and query string are separated)...

String url = "https://securesite.com" ;
String query = "user=xxx&passw ord=yyy";
HttpWebRequest webRequest = (HttpWebRequest )WebRequest.Cre ate(url);
webRequest.set_ ContentType("ap plication/x-www-form-urlencoded");
webRequest.set_ ContentLength(q uery.length());
webRequest.set_ Method("POST");
StreamWriter sw = new StreamWriter(we bRequest.GetReq uestStream());
sw.Write(query. ToString());
sw.Close();

Nevertheless, I just wanted to make sure that in the circumstance
previously described the resulting post would be 128-bit encrypted (one of
our clients needs to be certain their data is 128-bit encrypted).

You are awesome for helping out bud!

Thanks for your quick reply!

Mike Cronin

--
Message posted via http://www.dotnetmonster.com

Jul 21 '05 #9
You need to run a wiresniffer like ethereal to see which side is causing the
timeout or connection close. It is difficult to say by looking at the code.

Also, if all you want to do is forms post, you should look into using
WebClient class. You can do a FormsPost in WebCLient in 2-3 lines of code.

--
feroze

-----------------
This posting is provided as-is. It offers no warranties and assigns no
rights.

See http://weblogs.asp.net/feroze_daud for System.Net related posts.
----------------

"ne*****@noida. nospamhcltech.c om"
<ne************ **************@ discussions.mic rosoft.com> wrote in message
news:4F******** *************** ***********@mic rosoft.com...
I am using the following code to post data to the site on Domino server
but
always
gives the following error at this line
Dim streamWriter = New
System.IO.Strea mWriter(httpWeb Request.GetRequ estStream())

"Operation Timed OUT"
or
"Underlying Connection is Closed.."

I have used the following code :

Dim stringPost = "Username=xxx&P assword=yyy"

Dim httpWebRequest As System.Net.Http WebRequest =
System.Net.Http WebRequest.Crea te("https://corpmis.ggn.hcl tech.com//names.nsf?Login ")
httpWebRequest. ContentType = "applicatio n/x-www-form-urlencoded"
httpWebRequest. ContentLength = stringPost.Leng th
httpWebRequest. Method = "POST"

Dim streamWriter = New
System.IO.Strea mWriter(httpWeb Request.GetRequ estStream())
streamWriter.Wr ite(stringPost)
streamWriter.Cl ose()

Dim httpWebResponse As System.Net.Http WebResponse =
httpWebRequest. GetResponse()
Dim streamReader = New
System.IO.Strea mReader(httpWeb Response.GetRes ponseStream())
Dim stringResult = streamReader.Re adToEnd()
streamReader.Cl ose()
Please Help!!!!!

Thanks & Regards,
Neeraj

"Mike Cronin via DotNetMonster.c om" wrote:
Nope the actual code compiles fine and is used to POST requests to us.

I should have told you that I am working in J#. Using J#, I have a
set_ContentType () not ContentType() method exposed. Sorry about the
confusion.

One other thing, the logic did get a bit tweaked when I modified the
snippet for posting. The following reflects more accurately what is coded
(the URL and query string are separated)...

String url = "https://securesite.com" ;
String query = "user=xxx&passw ord=yyy";
HttpWebRequest webRequest = (HttpWebRequest )WebRequest.Cre ate(url);
webRequest.set_ ContentType("ap plication/x-www-form-urlencoded");
webRequest.set_ ContentLength(q uery.length());
webRequest.set_ Method("POST");
StreamWriter sw = new StreamWriter(we bRequest.GetReq uestStream());
sw.Write(query. ToString());
sw.Close();

Nevertheless, I just wanted to make sure that in the circumstance
previously described the resulting post would be 128-bit encrypted (one
of
our clients needs to be certain their data is 128-bit encrypted).

You are awesome for helping out bud!

Thanks for your quick reply!

Mike Cronin

--
Message posted via http://www.dotnetmonster.com

Jul 21 '05 #10

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

Similar topics

5
12345
by: Dan Battagin | last post by:
Is there a known bug with the interaction between the HttpWebRequest and the ThreadPool? I current spawn several HttpWebRequest's using BeginGetResponse, and they work for a while, using worker threads from the ThreadPool. However, eventually (relatively quickly) there become fewer and fewer available worker threads in the pool, until there are 0 and a System.InvalidOperationException occurs with the message: "There were not enough free...
16
12647
by: thomas peter | last post by:
I am building a precache engine... one that request over 100 pages on an remote server to cache them remotely... can i use the HttpWebRequest and WebResponse classes for this? or must i use the MSHTML objects to really load the HTML and request all of the images on site? string lcUrl = http://www.cnn.com; // *** Establish the request
9
4884
by: Matt Sollars | last post by:
I've exhausted all other avenues with this problem. Any help would be greatly appreciated. I am performing a simple POST via a HttpWebRequest object to an SSL URL (https://). I have attempted this to several different addresses with no luck. I've tried to supply a new ICertificatePolicy to the ServicePointManager as well. The oddity of the error that I'm receiving is it's happening before any data is even sent. Note: This code works...
1
2611
by: sfoxover | last post by:
Hi, Could someone please give me some suggestions on how to make this class robust. I need to be able to handle around 20 similtanious requests to this class which causes a web browser to display a waiting message while it requests XML data from a third party server. Some requests can take around 30 seconds. Usually the first time I do the request it always works. If I try again without closing the web browser it will fail sometimes....
6
4213
by: Mike Koerner | last post by:
Hi, I am having problems setting the HttpWebRequest Date header. I understand that it is a restricted header and I do receive the "This header must be modified with the appropriate property." Is there a way to make sure that the date header is sent over or a way to work around this exception? Here's a sample of the code:
10
524
by: Mike Cronin via DotNetMonster.com | last post by:
Hi there, Can anyone tell me what level of encryption is used when making an HTTPS POST request through an instance of the System.Net.HttpWebRequest object? Thanks much in advance! Mike Cronin Data On Call - Programmer
1
8047
by: Proogeren | last post by:
I have a problem with a httpwebrequest that I am creating. The request in itself looks correct but using fiddler I see that a www-authentication header is sent along as well. The code is pasted below. I do not add any www-authentication header here so I was wondering if anyone knows how to remove it. I have used almost 2 days trying to figure this out so help would be highly appreciated. CORRECT No proxy-authenticate header is present no...
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4045
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 we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.