ameshkov / dnscrypt

DNSCrypt v2 protocol implementation + a command-line tool
The Unlicense
74 stars 14 forks source link

Need 2 new function to solve unencrypted dial #10

Open iamsurfing opened 3 years ago

iamsurfing commented 3 years ago

github.com/ameshkov/dnscrypt/v2@v2.1.3/client.go:216 r, _, err := client.Exchange(query, stamp.ServerAddrStr)

It request certificate using plaintext not encrypted DNS request, so I want 2 functions to set certificate information.

new--->func (c Client) SetCertInfo(stamp dnsstamps.ServerStamp, certinfo dns.Msg) (ResolverInfo, error) from--->func (c Client) Dial(stampStr string) (ResolverInfo, error) new-->func (c Client) SetCertInfoByStamp(stampStr string, certinfo dns.Msg) (ResolverInfo, error) from--->func (c Client) DialStamp(stampStr string) (ResolverInfo, error)

ameshkov commented 3 years ago

It request certificate using plaintext not encrypted DNS request, so I want 2 functions to set certificate information.

That's how it's supposed to work according to DNSCrypt spec: https://dnscrypt.info/protocol/

If you want to avoid this, you can compose ResolverInfo manually without using these two functions.

iamsurfing commented 3 years ago

If It has 2 new functions, I think I can add a switch to control it.

11