From 34004c2ea4a2caa551dd2fadba9c54ce43e721dd Mon Sep 17 00:00:00 2001 From: Melinda Shore Date: Sat, 15 Jul 2017 10:46:08 +0200 Subject: [PATCH 1/4] Fixed compilation warning --- context.c | 1 - 1 file changed, 1 deletion(-) diff --git a/context.c b/context.c index f12bf77..1ec7352 100644 --- a/context.c +++ b/context.c @@ -1473,7 +1473,6 @@ context_config(getdns_ContextObject *self, PyObject *args, PyObject *keywds) return NULL; } getdns_config = pdict_to_gdict(py_config); - char buf[4096]; if ((ret = getdns_context_config(context, getdns_config)) != GETDNS_RETURN_GOOD) { PyErr_SetString(getdns_error, getdns_get_errorstr_by_id(ret)); return NULL; From 48f8c7a1c64fc6106ea801ee51c34dd8716bcdef Mon Sep 17 00:00:00 2001 From: Melinda Shore Date: Sat, 15 Jul 2017 13:12:00 +0200 Subject: [PATCH 2/4] fixed typo in constant name; updated Dockerfile --- Dockerfile | 4 ++-- getdns.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b3b98c..5542848 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM ubuntu:16.04 MAINTAINER Melinda Shore RUN set -ex \ @@ -34,7 +34,7 @@ RUN set -ex \ && ldconfig \ && mkdir -p /etc/unbound \ && cd /etc/unbound \ - && wget http://www.nomountain.net/getdns-root.key \ + && unbound-anchor -a /etc/unbound/getdns-root.key || : \ && cd /usr/src \ && git clone https://github.com/getdnsapi/getdns-python-bindings.git \ && cd /usr/src/getdns-python-bindings \ diff --git a/getdns.c b/getdns.c index 0978cf0..5fd7e88 100644 --- a/getdns.c +++ b/getdns.c @@ -618,7 +618,7 @@ add_getdns_constants(PyObject *g) PyModule_AddIntConstant(g, "CONTEXT_CODE_PUBKEY_PINSET", 621); PyModule_AddIntConstant(g, "CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", 622); PyModule_AddIntConstant(g, "CONTEXT_CODE_TLS_BACKOFF_TIME", 623); - PyModule_AddIntConstant(g, "CONTEXT_CODE_CONNECTION_RETRIES", 624); + PyModule_AddIntConstant(g, "CONTEXT_CODE_TLS_CONNECTION_RETRIES", 624); PyModule_AddIntConstant(g, "GETDNS_RETURN_NO_UPSTREAM_AVAILABLE", 398); PyModule_AddIntConstant(g, "GETDNS_RETURN_NEED_MORE_SPACE", 399); From 8fd454ca8305612c41a6348c4d1356d86fd9e949 Mon Sep 17 00:00:00 2001 From: Melinda Shore Date: Sun, 29 Oct 2017 22:33:36 -0700 Subject: [PATCH 3/4] First crack at a Dockerfile for Python 3 --- Dockerfile3 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Dockerfile3 diff --git a/Dockerfile3 b/Dockerfile3 new file mode 100644 index 0000000..6f44723 --- /dev/null +++ b/Dockerfile3 @@ -0,0 +1,46 @@ +FROM ubuntu:16.04 +MAINTAINER Melinda Shore + +RUN set -ex \ + && apt-get update \ + && apt-get install -y curl \ + && apt-get install -y git \ + && apt-get install -y wget \ + && apt-get install -y libssl-dev \ + && curl -fOSL "https://unbound.net/downloads/unbound-1.5.8.tar.gz" \ + && mkdir -p /usr/src/unbound \ + && tar -xzC /usr/src/unbound --strip-components=1 -f unbound-1.5.8.tar.gz \ + && rm unbound-1.5.8.tar.gz \ + && apt-get -y install libidn11-dev \ + && apt-get -y install python3-dev \ + && apt-get -y install make \ + && apt-get install -y automake autoconf libtool \ + && apt-get install -y shtool \ + && cd /usr/src/unbound \ + && ./configure \ + && make \ + && make install \ + && ldconfig \ + && cd /usr/src \ + && git clone https://github.com/getdnsapi/getdns.git \ + && cd /usr/src/getdns \ + && git checkout develop \ + && git submodule update --init \ + && libtoolize -ci \ + && autoreconf -fi \ + && ./configure \ + && make \ + && make install \ + && ldconfig \ + && mkdir -p /etc/unbound \ + && cd /etc/unbound \ + && unbound-anchor -a /etc/unbound/getdns-root.key || : \ + && cd /usr/src \ + && git clone https://github.com/getdnsapi/getdns-python-bindings.git \ + && cd /usr/src/getdns-python-bindings \ + && git checkout develop \ + && python3 setup.py build \ + && python3 setup.py install + + +CMD ["/usr/bin/python3"] From 1fcc026c61e6ea3c1b0635b010095a875aa7ec10 Mon Sep 17 00:00:00 2001 From: Melinda Shore Date: Tue, 21 Nov 2017 23:04:12 -0900 Subject: [PATCH 4/4] Added TLS demo querying 9.9.9.9 --- examples/quad9_tlsdemo.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 examples/quad9_tlsdemo.py diff --git a/examples/quad9_tlsdemo.py b/examples/quad9_tlsdemo.py new file mode 100755 index 0000000..553ea29 --- /dev/null +++ b/examples/quad9_tlsdemo.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import getdns + +u = [ { 'address_data': '9.9.9.9', 'address_type': 'IPv4', } ] + +c = getdns.Context() +c.resolution_type = getdns.RESOLUTION_STUB +c.dns_transport_list = [ getdns.TRANSPORT_TLS ] +c.upstream_recursive_servers = u +r = c.address('getdnsapi.net') +if r.status == getdns.RESPSTATUS_GOOD: + for a in r.just_address_answers: + print(a['address_data'])