Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

2007-08-13 Michal Ludvig <michal@logix.cz>

	* s3cmd, S3/Config.py, S3/S3.py: HTTPS support



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@132 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
commit d35b41f44c7935cd4319cb20cd1639af76971a2c 1 parent 1046516
Michal Ludvig mludvig authored

Showing 5 changed files with 23 additions and 1 deletion. Show diff stats Hide diff stats

  1. +4 0 ChangeLog
  2. +1 0  NEWS
  3. +2 1  S3/Config.py
  4. +2 0  S3/S3.py
  5. +14 0 s3cmd
4 ChangeLog
... ... @@ -1,3 +1,7 @@
  1 +2007-08-13 Michal Ludvig <michal@logix.cz>
  2 +
  3 + * s3cmd, S3/Config.py, S3/S3.py: HTTPS support
  4 +
1 5 2007-07-20 Michal Ludvig <michal@logix.cz>
2 6
3 7 * setup.py: Check correct Python version and ElementTree availability.
1  NEWS
@@ -2,6 +2,7 @@ s3cmd 0.9.4 - ...
2 2 ===========
3 3 * Support for transparent GPG encryption of uploaded files.
4 4 * HTTP proxy support
  5 +* HTTPS protocol support
5 6
6 7 s3cmd 0.9.3 - 2007-05-26
7 8 ===========
3  S3/Config.py
@@ -20,12 +20,13 @@ class Config(object):
20 20 force = False
21 21 acl_public = False
22 22 proxy_host = ""
23   - proxy_port = 8080
  23 + proxy_port = 3128
24 24 encrypt = False
25 25 gpg_passphrase = ""
26 26 gpg_command = ""
27 27 gpg_encrypt = "%(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s"
28 28 gpg_decrypt = "%(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s"
  29 + use_https = False
29 30
30 31 ## Creating a singleton
31 32 def __new__(self, configfile = None):
2  S3/S3.py
@@ -84,6 +84,8 @@ def __init__(self, config):
84 84 self.config = config
85 85
86 86 def get_connection(self):
  87 + if self.config.use_https:
  88 + return httplib.HTTPSConnection(self.config.host)
87 89 if self.config.proxy_host != "":
88 90 return httplib.HTTPConnection(self.config.proxy_host, self.config.proxy_port)
89 91 else:
14 s3cmd
@@ -278,6 +278,7 @@ def run_configure(config_file):
278 278 ("secret_key", "Secret Key"),
279 279 ("gpg_passphrase", "Encryption password", "Encryption password is used to protect your files from reading\nby unauthorized persons while in transfer to S3"),
280 280 ("gpg_command", "Path to GPG program"),
  281 + ("use_https", "Use HTTPS protocol", "When using secure HTTPS protocol all communication with Amazon S3\nservers is protected from 3rd party eavesdropping. This method is\nslower than plain HTTP and can't be used if you're behind a proxy"),
281 282 ("proxy_host", "HTTP Proxy server name", "On some networks all internet access must go through a HTTP proxy.\nTry setting it here if you can't conect to S3 directly"),
282 283 ("proxy_port", "HTTP Proxy server port"),
283 284 ]
@@ -297,8 +298,18 @@ def run_configure(config_file):
297 298 output("Refer to user manual for detailed description of all options.")
298 299 for option in options:
299 300 prompt = option[1]
  301 + ## Option-specific handling
  302 + if option[0] == 'proxy_host' and getattr(cfg, 'use_https') == True:
  303 + setattr(cfg, option[0], "")
  304 + continue
  305 + if option[0] == 'proxy_port' and getattr(cfg, 'proxy_host') == "":
  306 + setattr(cfg, option[0], 0)
  307 + continue
  308 +
300 309 try:
301 310 val = getattr(cfg, option[0])
  311 + if type(val) is bool:
  312 + val = val and "Yes" or "No"
302 313 if val not in (None, ""):
303 314 prompt += " [%s]" % val
304 315 except AttributeError:
@@ -309,6 +320,9 @@ def run_configure(config_file):
309 320
310 321 val = raw_input(prompt + ": ")
311 322 if val != "":
  323 + if type(getattr(cfg, option[0])) is bool:
  324 + # Turn 'Yes' into True, everything else into False
  325 + val = val.lower().startswith('y')
312 326 setattr(cfg, option[0], val)
313 327 output("\nNew settings:")
314 328 for option in options:

0 comments on commit d35b41f

Please sign in to comment.
Something went wrong with that request. Please try again.