المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Viewing SSL Certificate - C# Webbrowser Control



C# Programming
03-21-2010, 05:50 AM
I have an application that users collect data using a webbrowser control and a paser behind it to collect the data. When complete, users login in to a central site and we post the data collected.

We have a clever user that has changed their hosts file to redirect the posting to a server they hosted where they then have access to the data.

We are going to go with an SSL approach, but I need to make sure when we post the data that we are posting to the correct server and not a server someone has spoofed by changing their hosts file to point to a different server.

We'd like to be able to establish a SSL connection to our server and validate the certificate in code. We are using the webbrowser control and I am not sure how to access the certificate so that we can see if we are indeed connected to the correct server.

Any hints on how I might do this or where I might look?