2

Well i am implementing a Account Login system in my application in which i want to make sure that all the connections are secure so the user can't simply redirect the client connection to a mimicked server and gain access to the app without my permission. So here is the procedure i am imagining.

1- The HttpClient Connects to my SSL page.

2- Makes sure that the connection is secure (maybe by checking the certificate or something).

3- If the connection is secure it sends out the login credentials.

4- It receives the answer and if the account is valid it goes on, if not it terminated the connection.

So as you see my plane is very simple and i think it will be good to prevent some abusers or hacker from gaining access to my app without my permission and it relays on the powerful SSL certificate system; However, i don't know how could i implement this in real code so i really need your help illustrating how could i make sure that the HttpClient has connected to my real server using SSL and not anyone's fake server.

4

1 回答 1

0

这就是您所需要的 - 默认情况下会检查 SSL 证书的有效性/与域名的匹配。

var c = new System.Net.Http.HttpClient();
Console.Write(c.GetStringAsync("https://www.facebook.com/").Result);
于 2013-09-12T17:31:23.703 回答