SSL pinning with custom Root CA

solution for using certificates, signed with custom root CA.
based on example from https://github.com/dirkx/Security-Pinning-by-CA