Ejemplo n.º 1
0
 private void Setup(RequestsJsonSerializer jsonSerializer)
 {
     // allow tls 1.1 and 1.2
     ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
     // ReSharper disable once InconsistentlySynchronizedField
     _requestor      = new GitLabApiRequestor(_httpClient, jsonSerializer);
     _pagedRequestor = new GitLabApiPagedRequestor(_requestor);
 }
Ejemplo n.º 2
0
 private void Setup(RequestsJsonSerializer jsonSerializer, HttpClient httpClient)
 {
     // allow tls 1.1 and 1.2
     ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
     _httpClient     = httpClient;
     _requestor      = new GitLabApiRequestor(_httpClient, jsonSerializer);
     _pagedRequestor = new GitLabApiPagedRequestor(_requestor);
 }
Ejemplo n.º 3
0
 private void Setup(RequestsJsonSerializer jsonSerializer)
 {
     // allow tls 1.1 and 1.2
     ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
     ServicePointManager.ServerCertificateValidationCallback +=
         (sender, cert, chain, sslPolicyErrors) => true;
     // ReSharper disable once InconsistentlySynchronizedField
     _requestor      = new GitLabApiRequestor(_httpClient, jsonSerializer);
     _pagedRequestor = new GitLabApiPagedRequestor(_requestor);
 }
Ejemplo n.º 4
0
        public GitLabHttpFacade(string hostUrl, RequestsJsonSerializer jsonSerializer, string authenticationToken = "")
        {
            _httpClient = new HttpClient
            {
                BaseAddress = new Uri(hostUrl)
            };

            _httpClient.DefaultRequestHeaders.Add(PrivateToken, authenticationToken);
            _requestor      = new GitLabApiRequestor(_httpClient, jsonSerializer);
            _pagedRequestor = new GitLabApiPagedRequestor(_requestor);
        }
Ejemplo n.º 5
0
        public GitLabHttpFacade(string hostUrl, RequestsJsonSerializer jsonSerializer, string authenticationToken = "")
        {
            // allow tls 1.1 and 1.2
            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
            _httpClient = new HttpClient
            {
                BaseAddress = new Uri(hostUrl)
            };

            _httpClient.DefaultRequestHeaders.Add(PrivateToken, authenticationToken);
            _requestor      = new GitLabApiRequestor(_httpClient, jsonSerializer);
            _pagedRequestor = new GitLabApiPagedRequestor(_requestor);
        }
 public GitLabApiPagedRequestor(GitLabApiRequestor requestor) => _requestor = requestor;