changeset 682:74f54302aeb0

Auto-detect if we can use TLS or not.
author Martin Geisler <mg@daimi.au.dk>
date Fri, 25 Apr 2008 10:03:36 +0200
parents 12f075bee231
children 95a26f4d2a9e
files viff/runtime.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Fri Apr 25 09:49:28 2008 +0200
+++ b/viff/runtime.py	Fri Apr 25 10:03:36 2008 +0200
@@ -428,9 +428,15 @@
         group.add_option("--deferred-debug", action="store_true",
                          help="Enable extra debug output for deferreds.")
 
+        try:
+            import gnutls
+            have_gnutls = True
+        except ImportError:
+            have_gnutls = False
+
         parser.set_defaults(bit_length=32,
                             security_parameter=30,
-                            tls=True,
+                            tls=have_gnutls,
                             deferred_debug=False)
 
     def __init__(self, player, threshold, options=None):