Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
idHTTP and DNS over HTTPS
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
is there an internet conn...
by
Curt Carpenter
[
Today
at 07:52:48 pm]
VST summation time bugs
by
dseligo
[
Today
at 07:41:54 pm]
Circle - Syntax Error?
by
bytebites
[
Today
at 07:35:33 pm]
Smart Pointers, again rev...
by
Bogen85
[
Today
at 07:33:24 pm]
Adding custom .rc-file
by
KodeZwerg
[
Today
at 06:59:28 pm]
DatePointHintTool - inval...
by
Nicole
[
Today
at 06:54:56 pm]
Smart pointers revisited....
by
circular
[
Today
at 06:54:00 pm]
"TestAll" project issues
by
Aruna
[
Today
at 06:43:37 pm]
Type checking of units of...
by
qk
[
Today
at 06:42:31 pm]
more UTF8 confusing
by
JuhaManninen
[
Today
at 06:16:49 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: idHTTP and DNS over HTTPS (Read 366 times)
RDL
Jr. Member
Posts: 65
idHTTP and DNS over HTTPS
«
on:
November 20, 2022, 04:02:09 pm »
Hello.
I make a DoH request via curl, it works.
Code: Pascal
[Select]
[+]
[-]
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
[Select]
[+]
[-]
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?
«
Last Edit: November 20, 2022, 04:26:49 pm by RDL
»
Logged
Sorry for my english, google translation!
Bogen85
Sr. Member
Posts: 410
Re: idHTTP and DNS over HTTPS
«
Reply #1 on:
November 20, 2022, 05:36:59 pm »
Can you please provide a complete able to compile example?
Logged
Thaddy
Hero Member
Posts: 12623
Re: idHTTP and DNS over HTTPS
«
Reply #2 on:
November 20, 2022, 05:49:16 pm »
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)
«
Last Edit: November 20, 2022, 05:52:45 pm by Thaddy
»
Logged
The only thing I can say about Putin - born st Petersburg- is that he is indeed Russian, as opposed to Stalin, who was Georgian. Depending of historical time frame they could both be Lithuanian or Polish...even German. Shut him up!
RDL
Jr. Member
Posts: 65
Re: idHTTP and DNS over HTTPS
«
Reply #3 on:
November 22, 2022, 08:21:59 am »
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
«
Last Edit: November 22, 2022, 08:29:22 am by RDL
»
Logged
Sorry for my english, google translation!
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
idHTTP and DNS over HTTPS
TinyPortal
© 2005-2018