diff --git a/tuf/conf.py b/tuf/conf.py index c66ac2ff..e0c5fd7f 100755 --- a/tuf/conf.py +++ b/tuf/conf.py @@ -31,8 +31,3 @@ # which already exists and within that directory should have the file # 'metadata/current/root.txt'. This must be set! repository_directory = None - -# A directory where you may find certificate authorities -# https://en.wikipedia.org/wiki/Certificate_authority -# http://docs.python.org/2/library/ssl.html#certificates -ca_certs = None diff --git a/tuf/download.py b/tuf/download.py index e135e2f7..05d8b81b 100755 --- a/tuf/download.py +++ b/tuf/download.py @@ -25,15 +25,12 @@ import urllib2 import logging -import tuf.conf import tuf.hash import tuf.util import tuf.formats -import tuf.urllib2_ssl # See 'log.py' to learn how logging is handled in TUF. logger = logging.getLogger('tuf.download') -_opener = None def _open_connection(url): @@ -73,28 +70,13 @@ def _open_connection(url): # 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)' this can be useful if # servers do not recognize connections that originates from # Python-urllib/x.y. - global _opener - if _opener is None: - # If user has not asked for SSL certificate verification, - # use default opener. - if tuf.conf.ca_certs is None: - _opener = urllib2.build_opener() - # Otherwise, use an opener which will provide SSL certificate - # verification. - else: - _opener = urllib2.build_opener( - tuf.urllib2_ssl.HTTPSHandler( - ca_certs = tuf.conf.ca_certs - ) - ) - - response = _opener.open( url ) + request = urllib2.Request(url) + connection = urllib2.urlopen(request) + # urllib2.urlopen returns a file-like object: a handle to the remote data. + return connection except Exception, e: raise tuf.DownloadError(e) - - # urllib2.urlopen returns a file-like object: a handle to the remote data. - return response diff --git a/tuf/repo/signercli.py b/tuf/repo/signercli.py index f3166f86..60d50fa3 100755 --- a/tuf/repo/signercli.py +++ b/tuf/repo/signercli.py @@ -33,7 +33,7 @@ of the repository. For example, the repository owner wants to change the 'targets.txt' signing key. The owner would run 'signercli.py' to generate a new RSA key, add the new key to the configuration file created - by 'quickstart.py', and then run 'signercli' to update the metadata files. + by 'quickstart.py', and then run 'signercli.py' to update the metadata files. $ python signercli.py --