コード例 #1
0
        private static AuthenticatingHttpClientHandler CreateClientHandler(string user, string password, ClientConfiguration config)
        {
            var handler = new AuthenticatingHttpClientHandler(user, password);

#if NET45
            handler.ServerCertificateValidationCallback = OnCertificateValidation;
#else
            try
            {
                handler.ServerCertificateCustomValidationCallback = OnCertificateValidation;
            }
            catch (NotImplementedException)
            {
                Log.Debug("Cannot set ServerCertificateCustomValidationCallback, not supported on this platform");
            }

            if (config != null)
            {
                handler.MaxConnectionsPerServer = config.DefaultConnectionLimit;
            }
#endif

            return handler;
        }
コード例 #2
0
 internal CouchbaseHttpClient(AuthenticatingHttpClientHandler handler)
     : base(handler)
 {
 }