Questions tagged [servicepointmanager]
62 questions
11
votes
1 answer
c# httpclient post force single packet
Using Microsoft Message Analyzer, I can see that post data using the HttpClient is being sent in two tcp packets. One for the header, then one for the post data. This data could easily fit into one packet, however it is being split into two. I have…

Calvin Pietersen
- 141
- 7
10
votes
1 answer
Avoiding a ProtocolViolationException following a WebException
I'm working on resolving this bug:
https://github.com/openstacknetsdk/openstack.net/issues/333
The issue involves a ProtocolViolationException with the following message:
Chunked encoding upload is not supported on the HTTP/1.0 protocol.
I found…

Sam Harwell
- 97,721
- 20
- 209
- 280
8
votes
1 answer
What's the rationale for ServicePointManager.ServerCertificateValidationCallback being designed that way?
ServicePointManager.ServerCertificateValidationCallback is a global static property that can be overwritten by any bit of code in your application simply by doing:
ServicePointManager.ServerCertificateValidationCallback
= (sender, cert, chain,…

superlogical
- 14,332
- 9
- 66
- 76
6
votes
1 answer
ServicePointManager.ServerCertificateValidationCallback not being hit
I have the following code.
public void Submit(string XML)
{
ServicePointManager.ServerCertificateValidationCallback = ValidateCertificate;
TestWS.CW serv = new TestWS.CW();
string s = serv.Check(XML);
}
private static bool…

coolblue2000
- 3,796
- 10
- 41
- 62
5
votes
2 answers
'ServicePointManager.FindServicePoint(Uri)' is obsolete: Use HttpClient instead
Started getting this error after updating C# upgraded from NET 5 to 6-
Warning SYSLIB0014 'ServicePointManager.FindServicePoint(Uri)' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.'
var…

Abhav Luthra
- 61
- 3
5
votes
1 answer
PowerShell Invoke-WebRequest throws WebCmdletResponseException
When executing the line Invoke-WebRequest -Uri https://www.freehaven.net/anonbib/date.html PowerShell throws WebCmdletResponseException. How can I get more information about it, and what may be causing this? While I can successfully get the contents…

tinker
- 2,884
- 8
- 23
- 35
5
votes
0 answers
The correct way to permanently set properties on a ServicePoint
I would like to turn off Nagle algorithm on a specific connection (in my case - to an ElasticSearch server).
My code currently looks something like this:
ServicePointManager.FindServicePoint(new Uri(uriWithoutLocalPath)).UseNagleAlgorithm =…

Doron Yaacoby
- 9,412
- 8
- 48
- 59
5
votes
1 answer
WPF's Imagecontrol freezes the UI
I want to display a Users Gravatar in my WPF-Application. This is how I bind the Image-Control:
Where GravatarConverter returns the URL for the given…

zpete
- 1,725
- 2
- 18
- 31
4
votes
2 answers
C# HttpClient: Could not create SSL/TLS secure channel
i want to send a simple request to "https://etebarkala.com".
Tried from .net versions 4.5 to 4.8 with no success
This website opens easily with a browser
There isn't any ssl validation error or warnings
result:
The request was aborted: Could not…

Masoud Chegeni
- 41
- 1
- 3
4
votes
1 answer
In a in WinRT app, how do I connect using TLS1.2?
I've got a Windows Store app that's a WinRT Phone/Desktop app (i.e. not a UWP app), targeting Windows 8.1 and up.
It's been on the store for several years now, but recently it stopped being able to connect with various web APIs and websites…

Kyle Humfeld
- 1,887
- 4
- 23
- 28
4
votes
3 answers
HttpWebRequest always sending TLS 1.0
I'm connecting to a 3rd party API using HttpWebRequest and getting failures ("Underlying Connection closed") that the API doesn't support the version of TLS that's used for the request. I inspect the request in Fiddler and see that my request is…

unnknown
- 1,715
- 2
- 19
- 37
4
votes
1 answer
Using BindIPEndPointDelegate to specify the source port doesn't seem to work
I've searched all over on how to use BindIPEndPointDelegate to change the source port of my HttpWebRequest. I have found multiple posts on this:
Here and Here
However, It doesn't seem to be working for me. I found the same issue with this…

user1990373
- 41
- 2
3
votes
0 answers
Can turning on certification validation result in Application Insights data loss?
We are using Microsoft Application Insights for logging telemetry data. Suddenly it has stopped logging data for most of the users. We do the logging from a WPF application. We are suspecting turning on a…

Koushik
- 156
- 10
3
votes
1 answer
Why is this rear exception happening "System.IO.IOException" in MySql.Data.MySqlClient.MySqlConnection.Open()?
The stack trace details:
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.AggregateException: One or more errors occurred. ---> System.IO.IOException: Received an…

X-Coder
- 2,632
- 2
- 19
- 17
3
votes
0 answers
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception
I'm using ASP.NET Core 2.2, in which I'm consuming secure API (e.g.https://google.com) from non-secure portal.
But I am getting below error while requesting API :
System.Net.Http.HttpRequestException: The SSL connection could not be established,…

Pooja K Bhatt
- 979
- 2
- 10
- 18