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
Where are the components?...
by
TRon
[
Today
at 06:46:18 am]
Support for Git?
by
TRon
[
Today
at 06:40:35 am]
[UOS/PortAudio] Minimizin...
by
Hobbit1972
[
Today
at 06:39:58 am]
Synapse TCP/IP client and...
by
GetMem
[
Today
at 06:28:47 am]
Lines in different places...
by
Seenkao
[
Today
at 06:19:06 am]
Using old LCL
by
TRon
[
Today
at 06:17:23 am]
Novice, linux system Exce...
by
TRon
[
Today
at 06:07:31 am]
dll call fails, how to ch...
by
TRon
[
Today
at 05:49:59 am]
capture apl_exec stdout
by
TRon
[
Today
at 05:18:33 am]
help: can't find StrUtils...
by
Curt Carpenter
[
Today
at 05:16:52 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: idHTTP and DNS over HTTPS (Read 368 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: 431
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: 12640
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
"Looks" OK, doesn't mean it is IS OK.
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