Пример #1
0
 internal RestService(HttpAuthenticator authenticator, WebServiceUri webServiceUri, bool traceRequest, ITracer upstreamTracer)
 {
     this.authenticator = authenticator;
     this.componentId   = Globals.CertificateValidationComponentId;
     this.httpHeaders   = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
     this.traceRequest  = traceRequest;
     this.tracer        = upstreamTracer;
     this.targetUri     = webServiceUri.Uri;
     CertificateValidationManager.RegisterCallback(this.componentId, new RemoteCertificateValidationCallback(CertificateErrorHandler.CertValidationCallback));
 }
		public HttpClientHandler(ICertification certification, HttpAuthenticator authenticator)
		{
			if(certification == null)
				throw new ArgumentNullException("certification");

			if(authenticator == null)
				throw new ArgumentNullException("authenticator");

			_certification = certification;
			_authenticator = authenticator;
		}
Пример #3
0
 /// <since>4.3</since>
 public ProxyClient(HttpConnectionFactory <HttpRoute, ManagedHttpClientConnection>
                    connFactory, ConnectionConfig connectionConfig, RequestConfig requestConfig) : base
         ()
 {
     this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory
                        .Instance;
     this.connectionConfig = connectionConfig != null ? connectionConfig : ConnectionConfig
                             .Default;
     this.requestConfig = requestConfig != null ? requestConfig : RequestConfig.Default;
     this.httpProcessor = new ImmutableHttpProcessor(new RequestTargetHost(), new RequestClientConnControl
                                                         (), new RequestUserAgent());
     this.requestExec        = new HttpRequestExecutor();
     this.proxyAuthStrategy  = new ProxyAuthenticationStrategy();
     this.authenticator      = new HttpAuthenticator();
     this.proxyAuthState     = new AuthState();
     this.authSchemeRegistry = new AuthSchemeRegistry();
     this.authSchemeRegistry.Register(AuthSchemes.Basic, new BasicSchemeFactory());
     this.authSchemeRegistry.Register(AuthSchemes.Digest, new DigestSchemeFactory());
     this.authSchemeRegistry.Register(AuthSchemes.Ntlm, new NTLMSchemeFactory());
     this.authSchemeRegistry.Register(AuthSchemes.Spnego, new SPNegoSchemeFactory());
     this.authSchemeRegistry.Register(AuthSchemes.Kerberos, new KerberosSchemeFactory(
                                          ));
     this.reuseStrategy = new DefaultConnectionReuseStrategy();
 }
Пример #4
0
 public MainClientExec(HttpRequestExecutor requestExecutor, HttpClientConnectionManager
                       connManager, ConnectionReuseStrategy reuseStrategy, ConnectionKeepAliveStrategy
                       keepAliveStrategy, AuthenticationStrategy targetAuthStrategy, AuthenticationStrategy
                       proxyAuthStrategy, UserTokenHandler userTokenHandler)
 {
     Args.NotNull(requestExecutor, "HTTP request executor");
     Args.NotNull(connManager, "Client connection manager");
     Args.NotNull(reuseStrategy, "Connection reuse strategy");
     Args.NotNull(keepAliveStrategy, "Connection keep alive strategy");
     Args.NotNull(targetAuthStrategy, "Target authentication strategy");
     Args.NotNull(proxyAuthStrategy, "Proxy authentication strategy");
     Args.NotNull(userTokenHandler, "User token handler");
     this.authenticator      = new HttpAuthenticator();
     this.proxyHttpProcessor = new ImmutableHttpProcessor(new RequestTargetHost(), new
                                                          RequestClientConnControl());
     this.routeDirector      = new BasicRouteDirector();
     this.requestExecutor    = requestExecutor;
     this.connManager        = connManager;
     this.reuseStrategy      = reuseStrategy;
     this.keepAliveStrategy  = keepAliveStrategy;
     this.targetAuthStrategy = targetAuthStrategy;
     this.proxyAuthStrategy  = proxyAuthStrategy;
     this.userTokenHandler   = userTokenHandler;
 }