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
New VirtualTreeView for L...
by
af0815
[
Today
at 08:36:09 am]
Best way to parse file.
by
440bx
[
Today
at 08:32:41 am]
Make a Dynamic Shape Arra...
by
Boleeman
[
Today
at 07:48:37 am]
New Topic
by
circular
[
Today
at 07:46:54 am]
capture apl_exec stdout
by
TRon
[
Today
at 06:59:29 am]
Is there a function calle...
by
TRon
[
Today
at 06:48:32 am]
error release when memo.s...
by
dseligo
[
Today
at 05:40:29 am]
Controls inside the form ...
by
Ecsa
[
Today
at 04:02:37 am]
Theo's Searchbar plugin f...
by
Curt Carpenter
[
Today
at 03:54:33 am]
Search panel plugin for t...
by
Curt Carpenter
[
Today
at 03:51:49 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: idHTTP and DNS over HTTPS (Read 359 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: 367
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: 12543
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
Writing code in an overly complex way is usually merely a complete misunderstanding of the goal you are trying to achieve.
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