Forum > Networking and Web Programming

idHTTP and DNS over HTTPS

(1/1)

RDL:
Hello.
I make a DoH request via curl, it works.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---curl -H 'accept: application/dns-message' -k 'https://dns.yandex/dns-query?dns=AAABAAABAAAAAAAABG1haWwCcnUAAAEAAQ' | od -tcu1x1
I'm trying to make the same request through Indy, I get the message Connection Closed Gracefully.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---HTTP:=TIdHTTP.Create;HTTP.HandleRedirects:=True;HTTP.IOHandler:=SSL;HTTP.Request.Accept:='application/dns-message';HTTP.Get('https://dns.yandex/dns-query?dns=AAABAAABAAAAAAAABG1haWwCcnUAAAEAAQ',hsResponseStream);HTTP.Free;
What am I doing wrong?

Bogen85:
Can you please provide a complete able to compile example?

Thaddy:
If curl is installed, simply use libcurl, which is supported as standard.
It also works on Windows since 3.0.0. (I provided a patch, FPK commited it)

RDL:
I have attached an example program.
To compile, you need to install Indy from this pull request https://github.com/mezen/Indy/tree/NewOpenSSL_PR

It is not clear why this request works through curl, but not through indy

Navigation

[0] Message Index

Go to full version