HttpMessageHandler GetHandler()
        {
            HttpClientHandler innerHandler = new HttpClientHandler();

            if (!this.Config.Verify)
            {
                innerHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
            }
            TokenHandler tokenHandler = new TokenHandler(this.Config.ApiToken, innerHandler);

            return(tokenHandler);
        }
Example #2
0
        private HttpMessageHandler GetHandler()
        {
            var innerHandler = new HttpClientHandler();

            if (!Config.Verify)
            {
                innerHandler.ServerCertificateCustomValidationCallback = (httpRequestMessage, x509Certificate2, x509Chain, sslPolicyError) => true;
            }
            var tokenHandler = new TokenHandler(Config.ApiToken, innerHandler);

            return(tokenHandler);
        }