Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.libnetworkcache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
slapos.libnetworkcache
Commits
c6f302b0
Commit
c6f302b0
authored
Aug 01, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typo.
parent
68f4c30a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
slapos/libconnection.py
slapos/libconnection.py
+7
-6
No files found.
slapos/libconnection.py
View file @
c6f302b0
...
@@ -68,11 +68,12 @@ class HTTPSConnectionCertificateVerification(httplib.HTTPSConnection):
...
@@ -68,11 +68,12 @@ class HTTPSConnectionCertificateVerification(httplib.HTTPSConnection):
ca_certs
=
self
.
ssl_cert_path
,
ca_certs
=
self
.
ssl_cert_path
,
cert_reqs
=
ssl
.
CERT_REQUIRED
)
cert_reqs
=
ssl
.
CERT_REQUIRED
)
cert
=
self
.
sock
.
getpeercert
()
cert
=
self
.
sock
.
getpeercert
()
for
field
in
cert
[
'subject'
]:
if
cert
:
if
field
[
0
][
0
]
==
'commonName'
:
for
field
in
cert
[
'subject'
]:
certhost
=
field
[
0
][
1
]
if
field
[
0
][
0
]
==
'commonName'
:
if
certhost
!=
self
.
host
:
certhost
=
field
[
0
][
1
]
raise
ssl
.
SSLError
(
\
if
certhost
!=
self
.
host
:
raise
ssl
.
SSLError
(
\
"Host name '%s' doesn't match with the certificate host '%s'"
"Host name '%s' doesn't match with the certificate host '%s'"
%
(
self
.
host
,
certhost
))
%
(
self
.
host
,
certhost
))
...
@@ -90,7 +91,7 @@ class VerifiedHTTPSHandler(urllib2.HTTPSHandler):
...
@@ -90,7 +91,7 @@ class VerifiedHTTPSHandler(urllib2.HTTPSHandler):
def
install_opener_director
(
info_dict
):
def
install_opener_director
(
info_dict
):
if
info_dict
.
get
(
'schem
a
'
)
in
(
'https'
,):
if
info_dict
.
get
(
'schem
e
'
)
in
(
'https'
,):
https_handler
=
VerifiedHTTPSHandler
()
https_handler
=
VerifiedHTTPSHandler
()
url_opener
=
urllib2
.
build_opener
(
https_handler
)
url_opener
=
urllib2
.
build_opener
(
https_handler
)
urllib2
.
install_opener
(
url_opener
)
urllib2
.
install_opener
(
url_opener
)
...
...
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