Just wanted to add to the last answer. If you're using HTTP as connection protocol:
- use HTTPS with TLS1.2
- use key pinning to check if the server's certificate is valid
- use HSTS to prevent additional future MitM Attacks (prevents HTTPS->HTTP downgrade attacks)
- do not offer HTTP (or automatically upgrade to HTTPS)
- if possible, use client-side ssl certificate validation to validate the client's identity
- allow for perfect forward secrecy (PFS)
If you're using a custom protocol (not HTTPS) then:
- implement TLSv1.2
- use certificate pinning (at least server-side, if possible client-side)
- make sure you implement perfect forward secrecy