Questions tagged [servicepointmanager]

62 questions
3
votes
1 answer

Should I set ServicePointManager.DefaultConnectionLimit in a console application

I am calling this line of code 50000 times in a console application running as webjob in azure: await cloudBlockBlob.UploadFromFileAsync(sourceFile); // 50 kb files only Should I care at all about setting ServicePointManager.DefaultConnectionLimit…
Pascal
  • 12,265
  • 25
  • 103
  • 195
3
votes
1 answer

Maximum number of concurrent requests in Owin

I self-host a small web application in a console application using OWIN. Before reaching the ApiController there's a single middleware registered: public class HealthcheckMiddleware : OwinMiddleware { private readonly string…
SabrinaMH
  • 221
  • 1
  • 3
  • 11
3
votes
0 answers

c# Webrequest through https (configured) proxy (The ServicePointManager does not support proxies of https scheme)

I need to connect to a https-url by using a proxy which also has a https address. My code is simply like this: var webRequest = (HttpWebRequest)WebRequest.Create("https://reallywhatsthepoint.com"); var proxy = new WebProxy(new…
smack
  • 113
  • 7
3
votes
0 answers

HTTPS Proxy failing because of ServicePointManager

I'm trying to connect through a https proxy but an exception is always caught stating that "The ServicePointManager does not support proxies of https scheme". The code I'm using to test the connection is the following one : var handler = new…
Dash
  • 53
  • 1
  • 6
3
votes
1 answer

Can we add four protocols to ServicePointManager.SecurityProtocol?

I want to support all security protocols from ssl3 to tls 1.2 . But while searching on net I either found code as `ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11;` or as…
V K
  • 1,645
  • 3
  • 26
  • 57
3
votes
0 answers

How to detect which security protocol (SSL/TLS) is to be used for rest webservice call?

I am developing a winform application in which I make calls to REST webservices. For http based web servers it works fine.But,when it was used for a https based server, they recieved an exception The request was aborted: Could not create SSL/TLS…
V K
  • 1,645
  • 3
  • 26
  • 57
3
votes
1 answer

How to limit connections with Async HttpClient C#

I am trying to limit the number of max connections i have to an endpoint and I am doing this by setting ServicePointManager.DefaultConnectionLimit but it is not working. To test this I set up an endpoint that sleeps for 5 seconds and then…
Matt
  • 334
  • 5
  • 15
2
votes
1 answer

Disable SSL Verification to Post Data in IronPython

We recently migrated into a new development platform. We are still setting up some parts for our whole workflow to work without issues. We have this one problem where we need to promote a project into Production but we keep getting an error in the…
2
votes
0 answers

ConnectionManagementElement.MaxConnection and ServicePointManager.DefaultConnectionLimit

I'm trying to understand what the two properties ConnectionManagementElement.MaxConnection and ServicePointManager.DefaultConnectionLimit are used for in managing outbound connections for ASP.net applications and if a lower value in one would limit…
Aaron
  • 511
  • 3
  • 25
2
votes
0 answers

Binding web requests to specific network adapter

Background I have a mobile embedded device (Ubuntu/Mono) with 2 network adapters. One is WiFi and the other is GSM. The requirement is that when the WiFi adapter is connected to the internet (within range of a predetermined AP), the application…
2
votes
0 answers

System.ComponentModel.Win32Exception: The client and server cannot communicate, because t hey do not possess a common algorithm

I was trying to read the data returned from a url. Consider the following code: private static void Read() { _targetUrl = "https://url"; _proxyUrl = "http://differentUrl:8080"; ServicePointManager.ServerCertificateValidationCallback +=…
Khairul
  • 191
  • 2
  • 14
2
votes
1 answer

PSH Runspaces + New-WebServiceProxy = 2 connection limit?

I require a high performing script calling an in-house web service. So I wrote a powershell script to create runspace threads which each make a request to a common Web Service proxy object (New-WebServiceProxy). I figured out that regardless of the…
1
vote
0 answers

Xamarin Forms application - Force IPv4 to HttpClient

It appears that this can be achieved by setting up a callback function to the ServicePoint. The solution (although the goal is different, the same technique can be used) is discussed in this question Specify the local endpoint for HTTP…
1
vote
0 answers

.net version targeted by Excel - TLS issue

I have a C# dll build with target framework 4.6.1 that I am using in an Excel Add-in as well as in an executable (also build with target framework 4.6.1). I am not specifying ServicePointManager.SecurityProtocol in my dll so it can use the highest…
H J
  • 11
  • 1
1
vote
0 answers

HttpClient timing out requests after being active for sometime

I am using a single instance of System.Net.Http.HttpClient to send requests from a windows service to multiple RESTful API's. I ran into a strange issue where some of the HTTP requests are timing out at more or less regular intervals. I get lots of…
M22an
  • 1,242
  • 1
  • 18
  • 35