Git Product home page Git Product logo

Comments (6)

FlorianRappl avatar FlorianRappl commented on August 17, 2024

Hm bit of a strange thing. You post it here, but you did in fact use the DefaultHttpRequester, which is the one from AngleSharp. Are you sure you did not intend to use the HttpClientRequester?

Regarding the question: Potentially the CA verification fails. I'd recommend disabling HTTPS verification to see if this is the issue.

Related:
https://social.msdn.microsoft.com/Forums/en-US/2d5e64ca-e9af-402e-8852-dc4b70dc3c5f/http-post-request-gt-getresponse-hangs?forum=netfxnetcom
https://stackoverflow.com/questions/48969650/https-request-fails-only-in-net-web-app
https://stackoverflow.com/questions/42746190/https-request-fails-using-httpclient

from anglesharp.io.

TuTAH1 avatar TuTAH1 commented on August 17, 2024

You post it here, but you did in fact use the DefaultHttpRequester, which is the one from AngleSharp. Are you sure you did not intend to use the HttpClientRequester?

What is HttpClientRequester? I don't see this class in AngleSharp. DefaultHttpRequester is from AngleSharp.Io.

Regarding the question: Potentially the CA verification fails. I'd recommend disabling HTTPS verification to see if this is the issue.

It may be true (haven't checked yet), but why removing Form creating solves this problem (with absolute repeatability)?

from anglesharp.io.

FlorianRappl avatar FlorianRappl commented on August 17, 2024

What is HttpClientRequester? I don't see this class in AngleSharp. DefaultHttpRequester is from AngleSharp.Io.

You confuse a namespace with a library. The AngleSharp.Io namespace is already in AngleSharp, but this is the AngleSharp.Io library, which brings more requesters such as

https://github.com/AngleSharp/AngleSharp.Io/blob/devel/src/AngleSharp.Io/Network/HttpClientRequester.cs

It may be true (haven't checked yet), but why removing Form creating solves this problem (with absolute repeatability)?

Not sure what you refer to. You may run into a deadlock here, but again - from the description you focus on an HTTPS problem. Maybe first check there.

from anglesharp.io.

TuTAH1 avatar TuTAH1 commented on August 17, 2024

Not sure what you refer to.

Exactly what I wroted: see steps 1-4 you can reproduce.

I added

ServicePointManager.SecurityProtocol |=
	SecurityProtocolType.Tls12 | 
	SecurityProtocolType.Tls11 | 
	SecurityProtocolType.Tls;

to the start of my code, but it didn't solve my problem. I also tried use HttpClientRequester and have exactly same behavior.

var client = new HttpClient();
client.DefaultRequestHeaders.Add("Accept-Language", "en-US,en;q=0.812");
var requester = new HttpClientRequester(client);
var config = Configuration.Default.WithRequester(requester).WithDefaultLoader();
var context = BrowsingContext.New(config);
var document = await context.OpenAsync(urlAddress);

I also checked the document – response is empty if remove "https://". (I updated the example project)

The only way to get any responce from it is to remove any Froms creating before executing OpenAsync

from anglesharp.io.

FlorianRappl avatar FlorianRappl commented on August 17, 2024

image

The thing runs. As written you may run into a deadlock - I'd suggest to ConfigureAwait(false) or similar. In any case this does not seem like a problem with the requester or AngleSharp itself.

from anglesharp.io.

TuTAH1 avatar TuTAH1 commented on August 17, 2024

The thing runs. As written you may run into a deadlock - I'd suggest to ConfigureAwait(false) or similar. In any case this does not seem like a problem with the requester or AngleSharp itself.

This thing runs. Until you execute Form initialisation as I wroted in reproduction steps

ConfigureAwait(false) fixed it, thanks!

from anglesharp.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.