-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes-Bug: #1494892 - Functionality for secure (HTTPS) connection to…
… keystone and api-server using vnc-api Change-Id: I0e35de70be7d463b076e0e07b5b51474c23a3356
- Loading branch information
Showing
9 changed files
with
255 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4 | ||
# @author: Sanju Abraham, Juniper Networks, OpenContrail | ||
from requests.adapters import HTTPAdapter | ||
try: | ||
from urllib3.poolmanager import PoolManager | ||
except ImportError: | ||
# This is required for redhat7 as it does not have | ||
# separate urllib3 package installed | ||
from requests.packages.urllib3.poolmanager import PoolManager | ||
import ssl | ||
|
||
class SSLAdapter(HTTPAdapter): | ||
'''An HTTPS Transport Adapter that can be configured with SSL/TLS version.''' | ||
def __init__(self, ssl_version=None, **kwargs): | ||
self.ssl_version = ssl_version | ||
|
||
super(SSLAdapter, self).__init__(**kwargs) | ||
|
||
def init_poolmanager(self, connections, maxsize, block=False): | ||
self.poolmanager = PoolManager(num_pools=connections, | ||
maxsize=maxsize, | ||
block=block, | ||
ssl_version=self.ssl_version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.