aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2019-12-26 12:20:05 +0000
committerFelix Hanley <felix@userspace.com.au>2019-12-26 12:20:05 +0000
commit20d42b5b72f8d6d116206698ec241e04adea4359 (patch)
tree3849525a90e433cd850ce5aa377f52826be31be7
parent94f6e668feb91cd333c445677cde7c8ab4d062c0 (diff)
downloadtinydnsdyn-20d42b5b72f8d6d116206698ec241e04adea4359.tar.gz
tinydnsdyn-20d42b5b72f8d6d116206698ec241e04adea4359.tar.bz2
Fix SSL set up and require Python >2.7.9HEADv0.1.1master
Thanks to Tomas Astary.
-rw-r--r--README.md8
-rwxr-xr-xtinydnsdyn7
2 files changed, 9 insertions, 6 deletions
diff --git a/README.md b/README.md
index a6bb323..9b6bc12 100644
--- a/README.md
+++ b/README.md
@@ -9,10 +9,10 @@ It should run on any Linux or BSD with Python installed.
## Requirements
* Administrative access to a server running tinydns and hence
- daemontools or similar (such as runit in Void linux)
-* Administrative access to a *nix box on you local network
-* Python (version 2!) installed on both client and server
-* An open port on the server's firewall
+ daemontools or similar (such as runit in Void linux).
+* Administrative access to a *nix box on you local network.
+* Python (>2.7.9) installed on both client and server.
+* An open port on the server's firewall.
## Installation
diff --git a/tinydnsdyn b/tinydnsdyn
index f360b89..4a94bec 100755
--- a/tinydnsdyn
+++ b/tinydnsdyn
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python2
# Copyright 2011-2016 Felix Hanley <felix@userspace.com.au>
#
@@ -198,7 +198,10 @@ def main():
httpd = HTTPServer((options.address, options.port), RequestHandler)
if options.certfile and options.keyfile:
- httpd.socket = ssl.wrap_socket(httpd.socket, certfile=certfile, keyfile=keyfile, server_side=True)
+ context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
+ context.load_cert_chain(options.certfile, options.keyfile)
+ httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
+
httpd.serve_forever()