here is my scenario:
I have a website with php, mySQL. I have a software application that has a login screen and sends usernames and passwords over the web by http:
public String GetWebPageSource(String pURL)
{
try
{
byte[] vReceivedBytes = null;
using (System.Net.WebClient vWebClient = new System.Net.WebClient())
{
vReceivedBytes = vWebClient.DownloadData(pURL);
}
int vBomLen = 3;
byte[] vStrippedBytes = new byte[vReceivedBytes.Length - vBomLen];
Array.Copy(vReceivedBytes, vBomLen, vStrippedBytes, 0, vReceivedBytes.Length - vBomLen);
return System.Text.Encoding.UTF8.GetString(vStrippedBytes);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return null;
}
}
So to send a username and password I would write:
GetWebPageSource(“http://mywebsite.com/Login.php?username=stackoverflow&password=iscool”)
and the php file would spit out some text saying whether the password is accepted or denied.
However this is NOT secure. So I want to make it secure… https. How easy is it to integrate https? How much will the code change? How much do I have to handle? What is transparent to me. Do I have to check if a cookie already exists and if not write the methods for authentication or is there librarys already provided that will do it for me?
For programming point of view, calling an php script using http or https doesn’t make any difference. It’s just a matter of configuring apache (or any other web server) to handle https (most notably obtaining a certificate).