Im developing an application and i want this application to connect to my server via ssl (using openssl currently). I want this application to verify my servers certificate. The problem is i dont really know how to do that.
Do i store the full certificate chain in the applications binary and then verify the servers cert based on that? But then how do i handle a certificate change (im not sure how often root ca's and intermediates are going to change)? Or do i only store the Root CA and then step the certificate chain up automatically, downloading the intermediate certificates until i hit the root?
What is the best practice to do this?