Skip to content

Commit 8bcba92

Browse files
committed
Add an undocumented option to ignore cert timestamps
1 parent 05e07e8 commit 8bcba92

4 files changed

Lines changed: 23 additions & 17 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
A flexible DNS proxy, with support for encrypted DNS protocols such as [DNSCrypt](https://github.com/DNSCrypt/dnscrypt-protocol/blob/master/DNSCRYPT-V2-PROTOCOL.txt).
66

7-
## [dnscrypt-proxy 2.0.0beta6 is available for download!](https://github.com/jedisct1/dnscrypt-proxy/releases/latest)
7+
## [dnscrypt-proxy 2.0.0beta7 is available for download!](https://github.com/jedisct1/dnscrypt-proxy/releases/latest)
88

99
## Installation
1010

dnscrypt-proxy/certs.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ func FetchCurrentCert(proxy *Proxy, serverName *string, proto string, pk ed25519
8787
} else {
8888
certInfo.ForwardSecurity = true
8989
}
90-
if now > tsEnd || now < tsBegin {
91-
dlog.Debugf("[%v] Certificate not valid at the current date", providerName)
92-
continue
90+
if !proxy.certIgnoreTimestamp {
91+
if now > tsEnd || now < tsBegin {
92+
dlog.Debugf("[%v] Certificate not valid at the current date", providerName)
93+
continue
94+
}
9395
}
9496
if serial < highestSerial {
9597
dlog.Debugf("[%v] Superseded by a previous certificate", providerName)

dnscrypt-proxy/config.go

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Config struct {
2222
ForceTCP bool `toml:"force_tcp"`
2323
Timeout int `toml:"timeout_ms"`
2424
CertRefreshDelay int `toml:"cert_refresh_delay"`
25+
CertIgnoreTimestamp bool `toml:"cert_ignore_timestamp"`
2526
BlockIPv6 bool `toml:"block_ipv6"`
2627
Cache bool
2728
CacheSize int `toml:"cache_size"`
@@ -43,18 +44,19 @@ type Config struct {
4344

4445
func newConfig() Config {
4546
return Config{
46-
LogLevel: int(dlog.LogLevel()),
47-
ListenAddresses: []string{"127.0.0.1:53"},
48-
Timeout: 2500,
49-
CertRefreshDelay: 30,
50-
Cache: true,
51-
CacheSize: 256,
52-
CacheNegTTL: 60,
53-
CacheMinTTL: 60,
54-
CacheMaxTTL: 8600,
55-
SourceRequireNoLog: true,
56-
SourceIPv4: true,
57-
SourceIPv6: false,
47+
LogLevel: int(dlog.LogLevel()),
48+
ListenAddresses: []string{"127.0.0.1:53"},
49+
Timeout: 2500,
50+
CertRefreshDelay: 30,
51+
CertIgnoreTimestamp: false,
52+
Cache: true,
53+
CacheSize: 256,
54+
CacheNegTTL: 60,
55+
CacheMinTTL: 60,
56+
CacheMaxTTL: 8600,
57+
SourceRequireNoLog: true,
58+
SourceIPv4: true,
59+
SourceIPv6: false,
5860
}
5961
}
6062

@@ -139,6 +141,7 @@ func ConfigLoad(proxy *Proxy, svcFlag *string, config_file string) error {
139141
}
140142
proxy.certRefreshDelay = time.Duration(config.CertRefreshDelay) * time.Minute
141143
proxy.certRefreshDelayAfterFailure = time.Duration(10 * time.Second)
144+
proxy.certIgnoreTimestamp = config.CertIgnoreTimestamp
142145
if len(config.ListenAddresses) == 0 {
143146
return errors.New("No local IP/port configured")
144147
}

dnscrypt-proxy/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"golang.org/x/crypto/curve25519"
1717
)
1818

19-
const AppVersion = "2.0.0beta6"
19+
const AppVersion = "2.0.0beta7"
2020

2121
type Proxy struct {
2222
proxyPublicKey [32]byte
@@ -26,6 +26,7 @@ type Proxy struct {
2626
timeout time.Duration
2727
certRefreshDelay time.Duration
2828
certRefreshDelayAfterFailure time.Duration
29+
certIgnoreTimestamp bool
2930
mainProto string
3031
listenAddresses []string
3132
daemonize bool

0 commit comments

Comments
 (0)