summaryrefslogtreecommitdiff
path: root/glanceclient/common/https.py
Commit message (Collapse)AuthorAgeFilesLines
* Don't replace the https handler in the poolmanagerFlavio Percoco2014-10-301-2/+14
| | | | | | | | | | | | | | | | | In order to keep the support for `--ssl-nocompression` it was decided to overwrite the https HTTPAdapter in `requests` poolmanager. Although this seemed to work correctly, it was causing some issues when using glanceclient from other services that rely on requests and that were also configured to use TLS. THis patch changes implements a different strategy by using `glance+https` as the scheme to use when `no-compression` is requested. Closes-bug: #1350251 Closes-bug: #1347150 Closes-bug: #1362766 Change-Id: Ib25237ba821ee20a561a163b79402d1375ebed0b
* Ensure server's SSL cert is validatedStuart McLaren2014-08-191-1/+2
| | | | | | | | | | | A bug was introduced which meant that the server SSL certificate was not being verified. Here we make sure that it is checked (unless the --insecure flag is used). Helps guard against man-in-the-middle attack. Change-Id: I08f30bf3906b6580c871729311343fa8eefda91b Closes-bug: #1357430
* Fix glance-client to work with IPv6 controllersSudipta Biswas2014-08-061-1/+12
| | | | | | | | | | | | | | | | | | | Currently the glance client can't operate on IPv6 address based openstack controller IPs. The reason for this is the absence of creation of a IPv6 socket in the glance client code (in https.py). The glance client is trying to create sockets from the AF_INET socket family but this will lead to errors when glance client makes a call on the IPv6 IP addresses. In order to fix this limitation, we ensure that if the hostname resolves to IPv6 or an explicit IPv6 address is used to configure the openstack controller - glance client shall be able to detect that and then create a AF_INET6 socket family. In all other cases a AF_INET socket is created. We default to IPv4 sockets in all other cases. Change-Id: I7d5a09675cd5dab2e39f0faeaa7c169291eedac6 Closes-bug: #1348030
* Replace old httpclient with requestsAmalaBasha2014-07-101-0/+274
This review implements blueprint python-request and replaces the old http client implementation in favor of a new one based on python-requests. Major changes: * raw_request and json_request removed since everything is now being handled by the same method "_request" * New methods that match HTTP's methods were added: - get - put - post - head - patch - delete * Content-Type is now being "inferred" based on the data being sent: - if it is file-like object it chunks the request - if it is a python type not instance of basestring then it'll try to serialize it to json - Every other case will keep the incoming content-type and will send the data as is. * Glanceclient's HTTPSConnection implementation will be used if no-compression flag is set to True. Co-Author: Flavio Percoco<flaper87@gmail.com> Change-Id: I09f70eee3e2777f52ce040296015d41649c2586a