Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
Michael Ludvig mludvig authored
Showing with 23 additions and 1 deletion.
  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
View
@@ -1,3 +1,7 @@
+2007-08-13 Michal Ludvig <michal@logix.cz>
+
+ * s3cmd, S3/Config.py, S3/S3.py: HTTPS support
+
2007-07-20 Michal Ludvig <michal@logix.cz>
* setup.py: Check correct Python version and ElementTree availability.
1  NEWS
View
@@ -2,6 +2,7 @@ s3cmd 0.9.4 - ...
===========
* Support for transparent GPG encryption of uploaded files.
* HTTP proxy support
+* HTTPS protocol support
s3cmd 0.9.3 - 2007-05-26
===========
3  S3/Config.py
View
@@ -20,12 +20,13 @@ class Config(object):
force = False
acl_public = False
proxy_host = ""
- proxy_port = 8080
+ proxy_port = 3128
encrypt = False
gpg_passphrase = ""
gpg_command = ""
gpg_encrypt = "%(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s"
gpg_decrypt = "%(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s"
+ use_https = False
## Creating a singleton
def __new__(self, configfile = None):
2  S3/S3.py
View
@@ -84,6 +84,8 @@ def __init__(self, config):
self.config = config
def get_connection(self):
+ if self.config.use_https:
+ return httplib.HTTPSConnection(self.config.host)
if self.config.proxy_host != "":
return httplib.HTTPConnection(self.config.proxy_host, self.config.proxy_port)
else:
14 s3cmd
View
@@ -278,6 +278,7 @@ def run_configure(config_file):
("secret_key", "Secret Key"),
("gpg_passphrase", "Encryption password", "Encryption password is used to protect your files from reading\nby unauthorized persons while in transfer to S3"),
("gpg_command", "Path to GPG program"),
+ ("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"),
("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"),
("proxy_port", "HTTP Proxy server port"),
]
@@ -297,8 +298,18 @@ def run_configure(config_file):
output("Refer to user manual for detailed description of all options.")
for option in options:
prompt = option[1]
+ ## Option-specific handling
+ if option[0] == 'proxy_host' and getattr(cfg, 'use_https') == True:
+ setattr(cfg, option[0], "")
+ continue
+ if option[0] == 'proxy_port' and getattr(cfg, 'proxy_host') == "":
+ setattr(cfg, option[0], 0)
+ continue
+
try:
val = getattr(cfg, option[0])
+ if type(val) is bool:
+ val = val and "Yes" or "No"
if val not in (None, ""):
prompt += " [%s]" % val
except AttributeError:
@@ -309,6 +320,9 @@ def run_configure(config_file):
val = raw_input(prompt + ": ")
if val != "":
+ if type(getattr(cfg, option[0])) is bool:
+ # Turn 'Yes' into True, everything else into False
+ val = val.lower().startswith('y')
setattr(cfg, option[0], val)
output("\nNew settings:")
for option in options:
Please sign in to comment.
Something went wrong with that request. Please try again.