httpS &SSL

Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 128
Reputation: sivak has a little shameless behaviour in the past 
Solved Threads: 0
sivak sivak is offline Offline
Junior Poster

httpS &SSL

 
0
  #1
Jun 10th, 2009
can any one explain when and how we can use https and ssL IN c# .net..what is the use for it?
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,464
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 629
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: httpS &SSL

 
0
  #2
Jun 10th, 2009
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:
  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. }
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 124
Reputation: thewebhostingdi has a little shameless behaviour in the past 
Solved Threads: 11
thewebhostingdi thewebhostingdi is offline Offline
Junior Poster

Re: httpS &SSL

 
-1
  #3
Jun 11th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,464
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 629
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: httpS &SSL

 
0
  #4
Jun 11th, 2009
Originally Posted by thewebhostingdi View Post
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.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum


Views: 445 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC