summaryrefslogtreecommitdiff
path: root/tests/test_ssl.py
Commit message (Collapse)AuthorAgeFilesLines
* Don't replace the https handler in the poolmanagerFlavio Percoco2014-10-301-1/+11
| | | | | | | | | | | | | | | | | 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
* Replace old httpclient with requestsAmalaBasha2014-07-101-36/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Enable F841ChangBo Guo(gcb)2014-07-091-28/+25
| | | | | | | F841 detects local variable is assigned to but never used. This commit fixes the violations and enables F841 in gate. Change-Id: Ic4dcac2733dfe334009327ac17aa3952cafaa63a
* Fix CA certificate handlingStuart McLaren2014-06-251-0/+21
| | | | | | | | | | | | | | | | | | If --os-cacert was passed to the cli the following error was triggered: "cafile must be None or a byte string". This is because 'load_verify_locations' requires a byte string to be passed in. We fix this by explicitly converting the argument to a byte string. We do this in 'VerifiedHTTPSConnection' rather than sooner, eg during arg handling, as it will no longer be required should we move to a different http library (eg requests). Fixes bug 1301849. Change-Id: I9014f5d040cae9f0b6f03d8f13de8419597560cb
* Finalize Python3 supportFrederic Lepied2014-05-201-0/+2
| | | | | | | Set the environment variable PYTHONHASHSEED to 0 to have predictive tests under Python 3. Change-Id: Ia15a9383e0f20bd0e4572e9f9b9772f1704dff86
* Merge "Fix the parameter order of assertEqual in glanceclient test"Jenkins2014-04-211-7/+7
|\
| * Fix the parameter order of assertEqual in glanceclient testEiichi Aikawa2014-02-251-7/+7
| | | | | | | | | | | | | | | | | | On assertEqual, the order of parameters should be (expected, observed). But, some part of glanceclient test were written with invalid order. This patch fixes this problem. Change-Id: I7722fdce766ce3cc5bc9944dc72d7d0af0b09f69 Partially-bug: #1277104
* | Replace file with open, which is Python 3 compatibleAlex Gaynor2014-02-131-6/+6
|/ | | | Change-Id: I471ae9b372f88a508d4654b1a18c6da90397a828
* Fix misspellings in python-glanceclientShane Wang2014-02-071-2/+2
| | | | | | | | | Fix misspellings detected by: * pip install misspellings * git ls-files | grep -v locale | misspellings -f - Change-Id: I504521e702c675640ab3869c608fa96edd2477b4 Closes-Bug: #1257295
* Merge "Fix and enable gating on H306"Jenkins2013-12-231-1/+1
|\
| * Fix and enable gating on H306Dirk Mueller2013-12-161-1/+1
| | | | | | | | | | | | H306 - module imports should be in alphabetical order Change-Id: I1f8fc25b0e6ca23c21c90bda420f42a45141c2e2
* | SSL: Handle wildcards in Subject Alternative NamesDominik Heidler2013-12-111-0/+28
|/ | | | | | Closes-Bug: #1259528 Change-Id: Iedc2b98d47f1f9433a4cfd77e07f7f86bae806c1
* Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-201-1/+1
| | | | | Change-Id: I38dcbcf1a6c8efe540fcf5f29e782cb3826e583d Fixes-Bug: #1214176
* Allow single-wildcard SSL common name matchingBrian Waldon2013-08-211-0/+15
| | | | | | Fix bug 1212463 Change-Id: I168601fd9847497c2261c77ce6c856bca187c6c8
* Fix SSL certificate CNAME checkingThomas Leaman2013-07-151-5/+5
| | | | | | | | | | | | Currently, accessing a host via ip address will pass SSL verification; the CNAME is not checked as intended as part of verify_callback. 'preverify_ok is True' will always return false (int/bool comparison). preverify_ok will be 1 if preverification has passed. Fixes bug 1192229 Change-Id: Ib651548ab4289295a9b92ee039b2aff2d08aba5f
* Start using Pyflakes and HackingDirk Mueller2013-06-221-6/+6
| | | | | | | | | | Instead of globally ignoring pyflakes and hacking warnings, only blacklist those that trigger very frequently so far, in order to clean them up in followup commits. Fix and start gating on the rest already. Change-Id: Ied7c7250061e3bf379e8286e8ce3b9e4af817faf
* Improve unit tests for python-glanceclient.glanceclient.common.httpTatyana Leontovich2013-04-041-1/+46
| | | | | | | Add several tests for glanceclient.common.http module Fixes: bug #1149445 Change-Id: I6a47c64e11cefea276163777dcd559316fc8e0ad
* Use testtools instead of unittest.Monty Taylor2013-01-021-2/+2
| | | | | | Part of blueprint grizzly-testtools Change-Id: Ie914fd8f59cddb1a480566ec4eff908bfb51921c
* Support --os-cacertDean Troyer2012-12-111-12/+12
| | | | | | | | | | | | | * Rename --ca-file to --os-cacert (--ca-file deprecated for backward compatibility) * Add cacert to keystoneclient initialization to verify the keystone server certificate This aligns glanceclient with keystoneclient for option naming and the use of TLS for the keystone auth connection. It does not change the use of TLS/SSL for the glance connection. Change-Id: If8b05655aea5f3c62612d77bf947dd790f77eddf
* Verify that host matches certificateStuart McLaren2012-11-201-0/+74
| | | | | | | | | | When using https verify that the Common Name (CN) or the Subject Alternative Name listed in the server's certificate match the host we are connected to. Addresses LP bug 1079692. Change-Id: I24ea1511a2cbdb7c34ce72ac704d7b5e7d57cec2
* Implement blueprint ssl-connect-reworkStuart McLaren2012-10-081-0/+112
Use pyOpenSSL for HTTPS connections. This allows: * Neater loading of system CA files * Optional disabling of SSL compression The performance gain from disabling SSL compression is significant in cases where the image being uploaded/downloaded is in an already compressed format (eg qcow2). Related to bp ssl-connect-rework. Change-Id: I0568b6c95c5fc7b8eafdbd0284e24c453660a55a