In my iPhone application, I use an https connection with a self-signed SSL certificate to download reasonable data (username and password) from the server.
This application is intended for personal use only, it is not intended for production.
I use AFNetworking to control the https connection, but since my certificate is not signed from CA to make it work, I had to add the following to the header of the AFURLConnectionOperation class:
#define _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_ 1
But with this my application any certificate will be allowed.
Is there a way to allow only the certificate from my server, connect it in the application and compare it with the certificate provided by the server in the https connection? And if it were possible, was there any significant security advantage?
I am very new to security and I'm a little confused.
Biglex
source share