Commit Graph

107 Commits

Author SHA1 Message Date
Frank Denis 3a68f90c37 Back to 2.0.29 beta 3 (ceed905196) 2019-10-31 17:50:19 +01:00
Frank Denis 71e3cf4aef Add brackets around cached IPv6 IP addresses
Fixes #1005
2019-10-31 16:38:43 +01:00
Frank Denis a0614510e9 Don't name different things "ttl" to avoid confusion 2019-10-21 18:40:47 +02:00
Frank Denis ffd60d21db Reduce lock contention 2019-10-21 18:36:47 +02:00
Frank Denis 70970d2333 Nits 2019-10-21 18:31:06 +02:00
Markus Linnala bc831816f5 feature: xtransport: Expire CachedIPs, split resolve function from Fetch
I selected default ttl when resolving using system to be 86400 / 24h.

As the program can run long time, I think it is relevant to honor TTL
when resolving and caching results.

Change cache internal format from string to net.IP. This should ensure
there is no need to further check validity of value later when using.

Resolve part was too big and had only one purpose. So it is fine
candidate to be own function.
2019-10-21 18:12:49 +02:00
Markus Linnala d14d78e648 fix: xtransport: Check 'fallback_resolver'
And also DefaultFallbackResolver.

As far a I could see, value needs to have port defined
too. dns.Exchange does seem to use address as such.
2019-10-21 18:12:49 +02:00
Markus Linnala 890dcca270 fix: xtransport: Ensure we strip [] from host/ip before net.ParseIP 2019-10-21 18:12:49 +02:00
Markus Linnala ac4843b460 cleanup: xtransport: group all consts and alike
This is mainly for case where more consts are added.

Also I think those vars were not variables but treated as
const.
2019-10-21 18:12:49 +02:00
Markus Linnala a941cbd893 cleanup: xtransport: simplify body creation 2019-10-18 20:24:11 +02:00
Markus Linnala 345ec56cab cleanup: xtransport: move onion check earlier to fail fast 2019-10-18 20:24:11 +02:00
Markus Linnala df03065eaf change: xtransport: Return http response status string as error, do name make own string
This gives much better possibilities to diagnose problems than error
message with only "informative" part being 500.
2019-10-18 20:24:11 +02:00
Markus Linnala 72681725b1 clanup: xtransport: use MaxDNSPacketSize more 2019-10-18 20:24:11 +02:00
Markus Linnala 0d553a9fa7 cleanup: Drop ExtractPort ExtractHost, use ExtractHostAndPort instead 2019-10-18 20:24:11 +02:00
Markus Linnala f0fae0c756 cleanup: xtransport: There is no function level foundIP in resolveUsingResolver
Rename foundIPx to foundIP just to make it nicer looking.
2019-10-18 20:24:11 +02:00
Frank Denis 6b1966b38f Strip the port when caching the host part of URLs
Fixes #888
2019-09-07 15:31:34 +02:00
Frank Denis 0569c75596 Propagate mainProto to xTransport
Fixes #880
2019-07-10 13:13:28 +02:00
Frank Denis 7ca40df7c1 Save a line 2019-06-26 19:51:57 +02:00
Frank Denis 5c9edfccfe Ignore onion servers if Tor is not being used 2019-04-14 14:19:12 +02:00
Frank Denis 4940b34c76 Improve caching of server addresses, especially when using proxies 2019-04-14 13:46:07 +02:00
Frank Denis 4b001e3b8e Skip DNS resolution on Tor services 2019-04-14 11:18:14 +02:00
Frank Denis 4a7c932fdc Remove debug statement 2018-11-22 18:13:30 +01:00
Frank Denis 70bdd46425 Add a hash of the query to POST requests 2018-11-22 18:09:27 +01:00
Frank Denis fd9e97a570 Pad only once 2018-11-22 17:59:11 +01:00
Frank Denis 68ff5d2205 Set the Content-Length for POST queries 2018-11-22 17:23:22 +01:00
Frank Denis 2e147364e9 Add support for HTTP/HTTPS proxies
Fixes #638
2018-11-15 18:47:33 +01:00
Frank Denis 62755427a2 Always include the Accept: header in GET queries 2018-11-15 08:56:22 +01:00
Frank Denis d58d5ffbf6 Oh, Google updated their servers, and "body" is not required any more! 2018-10-03 18:33:10 +02:00
Frank Denis 0166f21b27 Add built-in support for Tor 2018-06-06 15:54:51 +02:00
Frank Denis da06657963 application/dns-message 2018-05-19 02:39:32 +02:00
Frank Denis 281c2fa7f4 Don't add padding if the query matches the block size
Fixes #446
2018-05-16 11:31:47 +02:00
Frank Denis 3d67c81697 Deps update 2018-04-18 18:58:39 +02:00
Frank Denis f63dc17f90 stamps -> dnsstamps 2018-04-18 18:47:10 +02:00
gdm85 eb5f391fa6 Split stamps into package 2018-04-18 18:36:47 +02:00
Frank Denis 3dbdf54c1f Warn about failed handshakes earlier and fallback to default suite 2018-04-11 11:42:30 +02:00
Frank Denis e3ad6b1c0e Actually use a cache if tlsDisableSessionTickets is not set 2018-04-10 00:36:55 +02:00
Frank Denis fbe91ee58b No need to initialize xTransport before we have all the parameters 2018-04-07 22:33:11 +02:00
Frank Denis 1fa3e5d7f3 Add options to set the cipher suite as well as disable session tickets 2018-04-07 22:23:29 +02:00
Frank Denis 308ffff739 Make the keepalive configurable
Fixes #300
2018-04-02 01:49:09 +02:00
Frank Denis 1ca7597c7f string(<int>) doesn't do what you may expect :) 2018-03-28 12:38:17 +02:00
Frank Denis 8bedb4b01e Add some helpers 2018-03-28 12:08:05 +02:00
Frank Denis 2568ea0b0c Revert "Switch to Quad114 as the default resolver"
This reverts commit 91f97833a3.

The Internet has become a sad place.

People in China need to use resolvers in China.
People in the US would not trust resolvers in China.
People in the EU would not trust resolvers in the US.

Revert to Quad9 for now, and add some documentation about why
that might be changed (especially in China) later.
2018-03-22 02:43:03 +01:00
Frank Denis 3c05b38edd Move local resolution to a dedicated function 2018-03-21 10:03:05 +01:00
Frank Denis d2805a19e4 DoH: only use the optional IP to bootstrap resolution
Fixes #100
2018-03-21 09:32:35 +01:00
Frank Denis 577ac5c91a When using a fallback resolver, favor IPv6 for DoH servers if use_ipv6 is set
Fixes #153
2018-03-21 09:05:30 +01:00
Frank Denis 91f97833a3 Switch to Quad114 as the default resolver
Quad9 current returns SERVFAIL for dnscrypt.info and there have
been reports of it not working as expected in some countries as well.
2018-03-21 08:30:36 +01:00
Frank Denis 963a54f6fe Print the IP, not the address 2018-03-20 15:10:12 +01:00
Frank Denis a0aeeabfa2 Nits 2018-03-17 14:47:17 -07:00
Frank Denis 4e671cf5ef Don't assume that A RRs will be first
Maybe
fixes #202
2018-03-02 12:28:56 +01:00
Frank Denis 0dfd4b70fc Add gross DoH padding since nobody could help with #58 2018-02-27 09:30:09 +01:00
Frank Denis 38fd879b56 Check record type in xTransport
Prepare for IPv6-only support by the way

Fixes #189
2018-02-26 14:50:01 +01:00
Frank Denis af0833387a Close idle connections after an error; reduce idle connections timeout 2018-02-05 19:03:04 +01:00
Frank Denis 5c52199ee1 draft 3 says queries should use "dns", previous drafts said "body"
Send both until servers adjust :/
2018-02-05 11:36:15 +01:00
Frank Denis 43f3e64bd9 DoH: fallback to GET on servers that don't support POST 2018-02-05 11:30:10 +01:00
Frank Denis 67b0d95ea1 Reduce log verbosity when ignore_system_dns = true
Fixes #81
2018-02-03 10:25:41 +01:00
Frank Denis 1d35e249c9 Add an option to always ignore the system resolver
This makes startup faster when DoH resolvers without a static IP
are used (Google).
2018-01-30 17:37:35 +01:00
Frank Denis 61bad01726 Import xtransport 2018-01-30 15:51:07 +01:00