Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
fdfc9245
Commit
fdfc9245
authored
Jun 24, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client check-hostname by default
parent
d5f44000
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
src/ZEO/component.xml
src/ZEO/component.xml
+1
-1
src/ZEO/tests/testssl.py
src/ZEO/tests/testssl.py
+6
-3
src/ZEO/zconfig.py
src/ZEO/zconfig.py
+1
-3
No files found.
src/ZEO/component.xml
View file @
fdfc9245
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
</description>
</description>
</key>
</key>
<key
name=
"check-hostname"
datatype=
"boolean"
required=
"no"
>
<key
name=
"check-hostname"
datatype=
"boolean"
required=
"no"
default=
"true"
>
<description>
<description>
Verify the host name in the server certificate is as expected.
Verify the host name in the server certificate is as expected.
</description>
</description>
...
...
src/ZEO/tests/testssl.py
View file @
fdfc9245
...
@@ -60,6 +60,7 @@ class SSLConfigTest(ZEOConfigTest):
...
@@ -60,6 +60,7 @@ class SSLConfigTest(ZEOConfigTest):
certificate {}
certificate {}
key {}
key {}
authenticate {}
authenticate {}
server-hostname zodb.org
</ssl>"""
.
format
(
client_cert
,
client_key
,
server_cert
))
</ssl>"""
.
format
(
client_cert
,
client_key
,
server_cert
))
self
.
_client_assertions
(
client
,
addr
)
self
.
_client_assertions
(
client
,
addr
)
client
.
close
()
client
.
close
()
...
@@ -200,6 +201,7 @@ class SSLConfigTest(ZEOConfigTest):
...
@@ -200,6 +201,7 @@ class SSLConfigTest(ZEOConfigTest):
self
.
assert_context
(
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
None
),
factory
,
context
,
(
client_cert
,
client_key
,
None
),
capath
=
here
,
capath
=
here
,
check_hostname
=
True
,
)
)
@
mock
.
patch
(
'ssl.create_default_context'
)
@
mock
.
patch
(
'ssl.create_default_context'
)
...
@@ -215,6 +217,7 @@ class SSLConfigTest(ZEOConfigTest):
...
@@ -215,6 +217,7 @@ class SSLConfigTest(ZEOConfigTest):
self
.
assert_context
(
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
None
),
factory
,
context
,
(
client_cert
,
client_key
,
None
),
cafile
=
server_cert
,
cafile
=
server_cert
,
check_hostname
=
True
,
)
)
@
mock
.
patch
(
'ssl.create_default_context'
)
@
mock
.
patch
(
'ssl.create_default_context'
)
...
@@ -231,8 +234,8 @@ class SSLConfigTest(ZEOConfigTest):
...
@@ -231,8 +234,8 @@ class SSLConfigTest(ZEOConfigTest):
None
)
None
)
self
.
assert_context
(
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
pwfunc
),
factory
,
context
,
(
client_cert
,
client_key
,
pwfunc
),
check_hostname
=
False
,
cafile
=
server_cert
,
cafile
=
server_cert
,
check_hostname
=
True
,
)
)
@
mock
.
patch
(
'ssl.create_default_context'
)
@
mock
.
patch
(
'ssl.create_default_context'
)
...
@@ -259,14 +262,14 @@ class SSLConfigTest(ZEOConfigTest):
...
@@ -259,14 +262,14 @@ class SSLConfigTest(ZEOConfigTest):
):
):
client
=
ssl_client
(
client
=
ssl_client
(
certificate
=
client_cert
,
key
=
client_key
,
authenticate
=
server_cert
,
certificate
=
client_cert
,
key
=
client_key
,
authenticate
=
server_cert
,
check_hostname
=
Tru
e
)
check_hostname
=
Fals
e
)
context
=
ClientStorage
.
call_args
[
1
][
'ssl'
]
context
=
ClientStorage
.
call_args
[
1
][
'ssl'
]
self
.
assertEqual
(
ClientStorage
.
call_args
[
1
][
'ssl_server_hostname'
],
self
.
assertEqual
(
ClientStorage
.
call_args
[
1
][
'ssl_server_hostname'
],
None
)
None
)
self
.
assert_context
(
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
None
),
factory
,
context
,
(
client_cert
,
client_key
,
None
),
cafile
=
server_cert
,
cafile
=
server_cert
,
check_hostname
=
Tru
e
,
check_hostname
=
Fals
e
,
)
)
def
args
(
*
a
,
**
kw
):
def
args
(
*
a
,
**
kw
):
...
...
src/ZEO/zconfig.py
View file @
fdfc9245
...
@@ -30,9 +30,7 @@ def ssl_config(section, server):
...
@@ -30,9 +30,7 @@ def ssl_config(section, server):
context
.
check_hostname
=
False
context
.
check_hostname
=
False
return
context
return
context
context
.
check_hostname
=
bool
(
context
.
check_hostname
=
section
.
check_hostname
section
.
check_hostname
is
None
and
(
section
.
server_hostname
or
not
auth
)
or
section
.
check_hostname
)
return
context
,
section
.
server_hostname
return
context
,
section
.
server_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