factor out certificate checking and pinning into flashproxy.keys