943,725 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 807
  • C# RSS
Jun 10th, 2009
0

httpS &SSL

Expand Post »
can any one explain when and how we can use https and ssL IN c# .net..what is the use for it?
Similar Threads
Reputation Points: 3
Solved Threads: 0
Junior Poster
sivak is offline Offline
132 posts
since Nov 2008
Jun 10th, 2009
0

Re: httpS &SSL

You use https:// in C# whenever you are accessing an https:// website. I don't really know of another way to answer that question. SSL is handled under the hood for the most part by the framework so you don't have to worry about it.

Here is an example of an https:// post to an online merchant:
c# Syntax (Toggle Plain Text)
  1. public void Post()
  2. {
  3. string args = GetPostUrlArgs();
  4. string result = string.Empty;
  5.  
  6. HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(@"https://secure.authorize.net/gateway/transact.dll");
  7. objRequest.Method = "POST";
  8. objRequest.ContentLength = args.Length;
  9. objRequest.ContentType = "application/x-www-form-urlencoded";
  10.  
  11. StreamWriter myWriter = null;
  12. try
  13. {
  14. myWriter = new StreamWriter(objRequest.GetRequestStream());
  15. myWriter.Write(args);
  16. }
  17. finally
  18. {
  19. myWriter.Close();
  20. myWriter.Dispose();
  21. }
  22.  
  23. HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
  24. using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
  25. {
  26. result = sr.ReadToEnd();
  27. sr.Close();
  28. sr.Dispose();
  29. }
  30.  
  31. this.Response = new CcTxResponse(result);
  32. }
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Jun 11th, 2009
-1

Re: httpS &SSL

There is nothing to do with https and SSL. in C#. All these are server side stuffs. If any domain is installed with SSL certification then that domain can be accessed by https. You need to have dedicated IP address for that website and that website needs to have SSL certificate installed within the IIS.
Last edited by thewebhostingdi; Jun 11th, 2009 at 10:22 am.
Reputation Points: 3
Solved Threads: 14
Junior Poster
thewebhostingdi is offline Offline
168 posts
since Jun 2009
Jun 11th, 2009
0

Re: httpS &SSL

There is nothing to do with https and SSL. in C#. All these are server side stuffs. If any domain is installed with SSL certification then that domain can be accessed by https. You need to have dedicated IP address for that website and that website needs to have SSL certificate installed within the IIS.
Please stop burning up the forum with useless posts, and in this case incorrect information. SSL extends beyond https. SSL/Secure Socket Layer allows you to create a secure socket between any two endpoints and https:// being one implementation of it.

C# Has plenty of types related to SSL:
System.Security.Cryptography.X509Certificates
System.Net.Security.SslStream

There are more, take a look at the help file.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: garbage collector
Next Thread in C# Forum Timeline: Saving Binary data to sql server 2000





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC