Skip to content

Commit f835e7c

Browse files
committed
Make pqdnscrypt a setting
1 parent 43bd978 commit f835e7c

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

dnscrypt-proxy/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type Config struct {
4242
CertRefreshConcurrency int `toml:"cert_refresh_concurrency"`
4343
CertRefreshDelay int `toml:"cert_refresh_delay"`
4444
CertIgnoreTimestamp bool `toml:"cert_ignore_timestamp"`
45+
PQDNSCrypt bool `toml:"pqdnscrypt"`
4546
EphemeralKeys bool `toml:"dnscrypt_ephemeral_keys"`
4647
LBStrategy string `toml:"lb_strategy"`
4748
LBEstimator bool `toml:"lb_estimator"`
@@ -131,6 +132,7 @@ func newConfig() Config {
131132
HTTP3: false,
132133
HTTP3Probe: false,
133134
CertIgnoreTimestamp: false,
135+
PQDNSCrypt: true,
134136
EphemeralKeys: false,
135137
Cache: true,
136138
CacheSize: 512,

dnscrypt-proxy/config_loader.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ func configureServerParams(proxy *Proxy, config *Config) {
191191
proxy.certRefreshDelay = time.Duration(Max(60, config.CertRefreshDelay)) * time.Minute
192192
proxy.certRefreshDelayAfterFailure = 10 * time.Second
193193
proxy.certIgnoreTimestamp = config.CertIgnoreTimestamp
194+
proxy.pqDNSCrypt = config.PQDNSCrypt
194195
proxy.ephemeralKeys = config.EphemeralKeys
195196
proxy.monitoringUI = config.MonitoringUI
196197
}

dnscrypt-proxy/dnscrypt_certs.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ func FetchCurrentDNSCryptCert(
121121
continue
122122
}
123123
isPQ := cryptoConstruction == XWingPQ
124+
if isPQ && !proxy.pqDNSCrypt {
125+
dlog.Debugf("[%v] ignoring post-quantum certificate, disabled in the configuration", *serverName)
126+
continue
127+
}
124128
if isPQ && len(binCert) < 1320 {
125129
dlog.Warnf("[%v] PQ certificate too short", *serverName)
126130
continue

dnscrypt-proxy/example-dnscrypt-proxy.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,14 @@ cert_refresh_delay = 240
282282
# dnscrypt_ephemeral_keys = false
283283

284284

285+
## PQDNSCrypt (DNSCrypt 2026): use post-quantum cryptography when supported
286+
## by the server.
287+
## This protects the confidentiality of your queries against future quantum
288+
## computers ("harvest now, decrypt later").
289+
290+
# pqdnscrypt = true
291+
292+
285293
## DoH: Disable TLS session tickets - increases privacy but also latency
286294

287295
# tls_disable_session_tickets = false

dnscrypt-proxy/proxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ type Proxy struct {
9797
ephemeralKeys bool
9898
pluginBlockUnqualified bool
9999
showCerts bool
100+
pqDNSCrypt bool
100101
certIgnoreTimestamp bool
101102
skipAnonIncompatibleResolvers bool
102103
anonDirectCertFallback bool

0 commit comments

Comments
 (0)