Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
4bf438d7
Kaydet (Commit)
4bf438d7
authored
Eki 13, 2014
tarafından
Aanand Prasad
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Enable the overriding of `assert_hostname` on TLSConfig
Signed-off-by:
Aanand Prasad
<
aanand.prasad@gmail.com
>
üst
7db976c1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
ssladapter.py
docker/ssladapter/ssladapter.py
+4
-2
tls.py
docker/tls.py
+6
-2
No files found.
docker/ssladapter/ssladapter.py
Dosyayı görüntüle @
4bf438d7
...
...
@@ -15,15 +15,17 @@ PoolManager = urllib3.poolmanager.PoolManager
class
SSLAdapter
(
HTTPAdapter
):
'''An HTTPS Transport Adapter that uses an arbitrary SSL version.'''
def
__init__
(
self
,
ssl_version
=
None
,
**
kwargs
):
def
__init__
(
self
,
ssl_version
=
None
,
assert_hostname
=
None
,
**
kwargs
):
self
.
ssl_version
=
ssl_version
self
.
assert_hostname
=
assert_hostname
super
(
SSLAdapter
,
self
)
.
__init__
(
**
kwargs
)
def
init_poolmanager
(
self
,
connections
,
maxsize
,
block
=
False
):
kwargs
=
{
'num_pools'
:
connections
,
'maxsize'
:
maxsize
,
'block'
:
block
'block'
:
block
,
'assert_hostname'
:
self
.
assert_hostname
,
}
if
self
.
can_override_ssl_version
():
kwargs
[
'ssl_version'
]
=
self
.
ssl_version
...
...
docker/tls.py
Dosyayı görüntüle @
4bf438d7
...
...
@@ -10,7 +10,7 @@ class TLSConfig(object):
ssl_version
=
None
def
__init__
(
self
,
client_cert
=
None
,
ca_cert
=
None
,
verify
=
None
,
ssl_version
=
None
):
ssl_version
=
None
,
assert_hostname
=
None
):
# Argument compatibility/mapping with
# http://docs.docker.com/examples/https/
# This diverges from the Docker CLI in that users can specify 'tls'
...
...
@@ -20,6 +20,7 @@ class TLSConfig(object):
# urllib3 sets a default ssl_version if ssl_version is None
# http://tinyurl.com/kxga8hb
self
.
ssl_version
=
ssl_version
self
.
assert_hostname
=
assert_hostname
# "tls" and "tls_verify" must have both or neither cert/key files
# In either case, Alert the user when both are expected, but any are
...
...
@@ -65,4 +66,7 @@ class TLSConfig(object):
client
.
verify
=
self
.
verify
if
self
.
cert
:
client
.
cert
=
self
.
cert
client
.
mount
(
'https://'
,
ssladapter
.
SSLAdapter
(
self
.
ssl_version
))
client
.
mount
(
'https://'
,
ssladapter
.
SSLAdapter
(
ssl_version
=
self
.
ssl_version
,
assert_hostname
=
self
.
assert_hostname
,
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment