Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS-over-HTTP support, making TLS optional #2729

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lch361
Copy link

@lch361 lch361 commented Nov 24, 2024

Motivation

There are many situations where DNSCrypt-proxy can run under the reverse TLS proxy. In that case, built-in DNSCrypt-proxy TLS server becomes redundant.

Solution

If the certificate and key are empty strings, instead of erroring out, start a server without TLS. Just pure HTTP.

Example

You can configure nginx like this:

http {
	ssl_certificate /etc/letsencrypt/live/whatever.net/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/whatever.net/privkey.pem;
	server {
		listen 443 ssl;
		root /srv/www;
		location /dns-query {
  			proxy_pass http://localhost:36153/;
		}
	}
}

And dnscrypt-proxy.toml like this:

[local_doh]
listen_addresses = ['[::1]:36153', '127.0.0.1:36153']
path = '/'

To get TLS from Nginx instead of dnscrypt-proxy.

Trivia

Tested this patch on my server, everything works just as I intended. Hopefully this will make a fine addition to this project :)

Triggers when TLS certificate and key are empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant