473,379 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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.HttpWebRequest object?

Thanks much in advance!

Mike Cronin
Data On Call - Programmer

--
Message posted via http://www.dotnetmonster.com
Jul 21 '05 #1
9 8130
what ever the server supports, not all servers support 128bit
"Mike Cronin via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:91******************************@DotNetMonste r.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.HttpWebRequest 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.com" <fo***@DotNetMonster.com> wrote in
message news:91******************************@DotNetMonste r.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.HttpWebRequest 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&password=yyy";
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.set_ContentType("application/x-www-form-urlencoded");
webRequest.set_ContentLength(query.length());
webRequest.set_Method("POST");
StreamWriter sw = new StreamWriter(webRequest.GetRequestStream());
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.X509Certificates?

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.com" <fo***@DotNetMonster.com> wrote in
message news:a1******************************@DotNetMonste r.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&password=yyy";
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.set_ContentType("application/x-www-form-urlencoded");
webRequest.set_ContentLength(query.length());
webRequest.set_Method("POST");
StreamWriter sw = new StreamWriter(webRequest.GetRequestStream());
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.X509Certificates?

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&password=yyy";
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.set_ContentType("application/x-www-form-urlencoded");
webRequest.set_ContentLength(query.length());
webRequest.set_Method("POST");
StreamWriter sw = new StreamWriter(webRequest.GetRequestStream());
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.StreamWriter(httpWebRequest.GetRequestSt ream())

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

I have used the following code :

Dim stringPost = "Username=xxx&Password=yyy"

Dim httpWebRequest As System.Net.HttpWebRequest =
System.Net.HttpWebRequest.Create("https://corpmis.ggn.hcltech.com//names.nsf?Login")
httpWebRequest.ContentType = "application/x-www-form-urlencoded"
httpWebRequest.ContentLength = stringPost.Length
httpWebRequest.Method = "POST"

Dim streamWriter = New
System.IO.StreamWriter(httpWebRequest.GetRequestSt ream())
streamWriter.Write(stringPost)
streamWriter.Close()

Dim httpWebResponse As System.Net.HttpWebResponse =
httpWebRequest.GetResponse()
Dim streamReader = New
System.IO.StreamReader(httpWebResponse.GetResponse Stream())
Dim stringResult = streamReader.ReadToEnd()
streamReader.Close()
Please Help!!!!!

Thanks & Regards,
Neeraj

"Mike Cronin via DotNetMonster.com" 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&password=yyy";
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.set_ContentType("application/x-www-form-urlencoded");
webRequest.set_ContentLength(query.length());
webRequest.set_Method("POST");
StreamWriter sw = new StreamWriter(webRequest.GetRequestStream());
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.com"
<ne**************************@discussions.microsof t.com> wrote in message
news:4F**********************************@microsof t.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.StreamWriter(httpWebRequest.GetRequestSt ream())

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

I have used the following code :

Dim stringPost = "Username=xxx&Password=yyy"

Dim httpWebRequest As System.Net.HttpWebRequest =
System.Net.HttpWebRequest.Create("https://corpmis.ggn.hcltech.com//names.nsf?Login")
httpWebRequest.ContentType = "application/x-www-form-urlencoded"
httpWebRequest.ContentLength = stringPost.Length
httpWebRequest.Method = "POST"

Dim streamWriter = New
System.IO.StreamWriter(httpWebRequest.GetRequestSt ream())
streamWriter.Write(stringPost)
streamWriter.Close()

Dim httpWebResponse As System.Net.HttpWebResponse =
httpWebRequest.GetResponse()
Dim streamReader = New
System.IO.StreamReader(httpWebResponse.GetResponse Stream())
Dim stringResult = streamReader.ReadToEnd()
streamReader.Close()
Please Help!!!!!

Thanks & Regards,
Neeraj

"Mike Cronin via DotNetMonster.com" 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&password=yyy";
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.set_ContentType("application/x-www-form-urlencoded");
webRequest.set_ContentLength(query.length());
webRequest.set_Method("POST");
StreamWriter sw = new StreamWriter(webRequest.GetRequestStream());
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
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...
16
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...
9
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...
1
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...
6
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." ...
10
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...
1
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.