Skip to content

Commit 7ced70a

Browse files
authored
Merge pull request #66 from HuseinA/master
Update: Turn off verify ssl when bucket name have dot
2 parents 977f3dd + 1504405 commit 7ced70a

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Unreleased
22
==========
33

4+
0.3.4 (2021-10-29)
5+
==================
6+
- Update turn off verify ssl when bucket name have dot
7+
8+
49
0.3.3 (2021-08-31)
510
==================
611
- Update Use raise instead return for response with error

obs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.3"
1+
__version__ = "0.3.4"

obs/libs/bucket.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def neo_create_bucket(**kwargs):
5555
endpoint = auth_lib.get_endpoint("storage", bucket_name)
5656
headers = {"x-gmt-policyid": policy_id, "x-amz-acl": acl}
5757

58-
response = requests.put(endpoint, auth=auth, headers=headers)
58+
if "." in bucket_name:
59+
response = requests.put(endpoint, auth=auth, headers=headers, verify=False)
60+
else:
61+
response = requests.put(endpoint, auth=auth, headers=headers)
5962
return response
6063

6164

obs/libs/gmt.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ def policy_id(bucket_name, auth):
2929
"""Get GMT-Policy id from S3 API response headers."""
3030

3131
endpoint = auth_lib.get_endpoint("storage", bucket_name)
32-
response = requests.get(endpoint, auth=auth)
32+
if "." in bucket_name:
33+
response = requests.get(endpoint, auth=auth, verify=False)
34+
else:
35+
response = requests.get(endpoint, auth=auth)
36+
3337
policy_id = response.headers.get("x-gmt-policyid")
3438

3539
return policy_id

0 commit comments

Comments
 (0)