I\'m not sure is similar question has been asked before (I couldn\'t find any), but is it possible to protect Client/Server from Man-In-The-Middle attack?
I\'m writin
You can hard-code the server's certificate and compare it against what you receive.
Or better yet, create a CA certificate and server certificate, signed by the CA. Have the CA trusted on the client (again by hardcoding it in your application) and validate received server certificate using the CA certificate.