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
94cb0bdc
Kaydet (Commit)
94cb0bdc
authored
Haz 24, 2014
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed bugs, clearer error messages
üst
72c29ee5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
client.py
docker/client.py
+1
-1
tls.py
docker/tls.py
+14
-10
No files found.
docker/client.py
Dosyayı görüntüle @
94cb0bdc
...
...
@@ -61,7 +61,7 @@ class Client(requests.Session):
self
.
_timeout
=
timeout
self
.
_auth_configs
=
auth
.
load_config
()
""" Use SSLAdapter for the ability to specify SSL version """
# Use SSLAdapter for the ability to specify SSL version
if
isinstance
(
tls
,
TLSConfig
):
tls
.
configure_client
(
self
)
elif
tls
:
...
...
docker/tls.py
Dosyayı görüntüle @
94cb0bdc
...
...
@@ -5,6 +5,10 @@ from .ssladapter import ssladapter
class
TLSConfig
(
object
):
cert
=
None
verify
=
None
ssl_version
=
None
def
__init__
(
self
,
tls
,
tls_cert
=
None
,
tls_key
=
None
,
tls_verify
=
False
,
tls_ca_cert
=
None
,
ssl_version
=
None
):
# Argument compatibility/mapping with
...
...
@@ -25,11 +29,12 @@ class TLSConfig(object):
if
not
(
tls_cert
and
tls_key
)
or
(
not
os
.
path
.
isfile
(
tls_cert
)
or
not
os
.
path
.
isfile
(
tls_key
)):
raise
errors
.
TLSParameterError
(
'You must provide either both "tls_cert"/"tls_key" files, '
'or neither, in order to use TLS.'
)
'Client certificate must provide certificate and key files'
' through tls_cert and tls_key params respectively'
)
self
.
cert
=
(
tls_cert
,
tls_key
)
# Either set
tls_
verify to True (public/default CA checks) or to the
# Either set verify to True (public/default CA checks) or to the
# path of a CA Cert file.
if
tls_verify
:
if
not
tls_ca_cert
:
...
...
@@ -38,14 +43,13 @@ class TLSConfig(object):
self
.
verify
=
tls_ca_cert
else
:
raise
errors
.
TLSParameterError
(
'If "tls_verify" is set, then "tls_ca_cert" must be blank'
' (to check public CA list) OR a path to a Cert File.'
'Invalid CA certificate provided for `tls_ca_cert`.'
)
else
:
self
.
verify
=
False
def
configure_client
(
self
,
client
):
client
.
verify
=
self
.
verify
client
.
ssl_version
=
self
.
ssl_version
client
.
cert
=
self
.
cert
self
.
mount
(
'https://'
,
ssladapter
.
SSLAdapter
(
self
.
ssl_version
))
if
self
.
verify
is
not
None
:
client
.
verify
=
self
.
verify
if
self
.
cert
:
client
.
cert
=
self
.
cert
client
.
mount
(
'https://'
,
ssladapter
.
SSLAdapter
(
self
.
ssl_version
))
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