Handle [SSL: CERTIFICATE_VERIFY_FAILED] exception

This patch removes all the duplicated code blocks
related to HTTP requests, improves the way that
the exceptions are handled and adds a new base class
for all the metadata providers which use HTTP(S)
protocol in order to serve information.

Change-Id: Ib36b0cf592310bb1e6cc4aec4fc2b9b5f29f1759
Co-Authored-By: Alexandru Tudose <atudose@cloudbasesolutions.com>
This commit is contained in:
Alexandru Coman
2016-07-13 20:29:35 +03:00
parent 6c6ef0e11a
commit 7078b58038
15 changed files with 289 additions and 313 deletions

View File

@@ -36,6 +36,14 @@ class EC2Options(conf_base.Options):
help="Add a route for the metadata ip address to the gateway",
deprecated_name="ec2_add_metadata_private_ip_route",
deprecated_group="DEFAULT"),
cfg.BoolOpt(
"https_allow_insecure", default=False,
help="Whether to disable the validation of HTTPS "
"certificates."),
cfg.StrOpt(
"https_ca_bundle", default=None,
help="The path to a CA_BUNDLE file or directory with "
"certificates of trusted CAs."),
]
def register(self):