ameshkov/dnscrypt

Need 2 new function to solve unencrypted dial

iamsurfing opened this issue · 2 comments

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)

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.

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