Skip to content

Commit 5c7bfc2

Browse files
committed
update example secret key / cert, etc.
1 parent f44651f commit 5c7bfc2

File tree

10 files changed

+30
-14
lines changed

10 files changed

+30
-14
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ On OpenBSD:
3838

3939
$ pkg_add -r gmake autoconf
4040
$ pkg_add -r libevent
41+
$ git clone --recursive git://github.com/cofyc/dnscrypt-wrapper.git
42+
$ cd dnscrypt-wrapper
4143
$ gmake LDFLAGS='-L/usr/local/lib/' CFLAGS=-I/usr/local/include/
4244

4345
On MacOS:
4446

45-
$ brew install dnscrypt-wrapper # best recommended
47+
$ brew install dnscrypt-wrapper
4648

4749
In Docker:
4850

@@ -72,7 +74,9 @@ This will print it out.
7274
and authenticate DNS queries. Also generate a certificate for it:
7375

7476
$ dnscrypt-wrapper --gen-crypt-keypair --crypt-secretkey-file=1.key
75-
$ dnscrypt-wrapper --gen-cert-file --crypt-secretkey-file=1.key --provider-cert-file=1.cert
77+
$ dnscrypt-wrapper --gen-cert-file --crypt-secretkey-file=1.key --provider-cert-file=1.cert \
78+
--provider-publickey-file=public.key --provider-secretkey-file=secret.key \
79+
--cert-file-expire-days=365
7680

7781
In this example, the time-limited secret key will be saved as `1.key`
7882
and its related certificate as `1.cert` in the current directory.
@@ -82,7 +86,7 @@ without requiring clients to update their configuration.
8286

8387
3) Run the program with a given key, a provider name and the most recent certificate:
8488

85-
# dnscrypt-wrapper --resolver-address=114.114.114.114:53 --listen-address=0.0.0.0:443 \
89+
# dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:443 \
8690
--provider-name=2.dnscrypt-cert.yechengfu.com \
8791
--crypt-secretkey-file=1.key --provider-cert-file=1.cert
8892

@@ -171,7 +175,7 @@ its certificate:
171175
2) Tell new users to use the new certificate but still accept the old
172176
key until all clients have loaded the new certificate:
173177

174-
# dnscrypt-wrapper --resolver-address=114.114.114.114:53 --listen-address=0.0.0.0:443 \
178+
# dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:443 \
175179
--provider-name=2.dnscrypt-cert.yechengfu.com \
176180
--crypt-secretkey-file=1.key,2.key --provider-cert-file=2.cert
177181

@@ -182,7 +186,7 @@ accept both the previous and the current key.
182186
after one hour, the old certificate can be refused, by leaving only
183187
the new one in the configuration:
184188

185-
# dnscrypt-wrapper --resolver-address=114.114.114.114:53 --listen-address=0.0.0.0:443 \
189+
# dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:443 \
186190
--provider-name=2.dnscrypt-cert.yechengfu.com \
187191
--crypt-secretkey-file=2.key --provider-cert-file=2.cert
188192

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fi
6666

6767
# libsodium
6868
AC_ARG_WITH(sodium,
69-
[AS_HELP_STRING([--with-sodium=DIR], [where to find the event library])],
69+
[AS_HELP_STRING([--with-sodium=DIR], [where to find the sodium library])],
7070
[if test -d "$withval"; then
7171
LDFLAGS="$LDFLAGS -L$withval/lib"
7272
CFLAGS="$CFLAGS -I$withval/include"

example/1.cert

124 Bytes
Binary file not shown.

example/1.key

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@ÐH����{�� :�����ʥ��|]n

example/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@ A demo example.
44

55
## Usage
66

7+
1, open a new terminal, run
8+
79
```
810
./start_wrapper.sh
11+
```
12+
13+
2, open a new terminal, run
14+
15+
```
916
./start_proxy.sh
17+
```
18+
19+
3, test
20+
21+
```
1022
dig www.google.com @127.0.0.1 -p 8855
1123
```

example/crypt_secret.key

Lines changed: 0 additions & 2 deletions
This file was deleted.

example/dnscrypt.cert

-124 Bytes
Binary file not shown.

example/start_proxy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22

3-
dnscrypt-proxy -d -a 127.0.0.1:8855 -r 127.0.0.1:8854 \
3+
dnscrypt-proxy -a 127.0.0.1:8855 -r 127.0.0.1:8854 \
44
--provider-name=2.dnscrypt-cert.yechengfu.com \
55
--provider-key=3686:91DF:DC22:8DBB:67BF:9EF6:5471:C831:B468:E0F8:18D9:6CB1:254E:3BE7:7A88:AB24

example/start_wrapper.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

3-
../dnscrypt-wrapper --resolver-address=114.114.114.114:53 --listen-address=0.0.0.0:8854 \
3+
../dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:8854 \
44
--provider-name=2.dnscrypt-cert.yechengfu.com \
5-
--provider-cert-file=dnscrypt.cert \
6-
--crypt-secretkey-file=crypt_secret.key \
5+
--provider-cert-file=1.cert \
6+
--crypt-secretkey-file=1.key \
77
-VV

main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ main(int argc, const char **argv)
336336
exit(1);
337337
}
338338
}
339+
339340
// setup logger
340341
if (c.logfile) {
341342
logger_logfile = c.logfile;
@@ -416,9 +417,9 @@ main(int argc, const char **argv)
416417
printf("* Record for tinydns:\n");
417418
cert_display_txt_record_tinydns(signed_cert);
418419
printf("\n");
419-
if (!write_to_file
420+
if (write_to_file
420421
(c.provider_cert_file, (char *)signed_cert,
421-
sizeof(struct SignedCert)) == 0) {
422+
sizeof(struct SignedCert)) != 0) {
422423
logger(LOG_ERR, "The new certificate was not saved - "
423424
"Maybe the %s file already exists - please delete it first.",
424425
c.provider_cert_file);

0 commit comments

Comments
 (0)