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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
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 @@
</description>
</key>
<key
name=
"check-hostname"
datatype=
"boolean"
required=
"no"
>
<key
name=
"check-hostname"
datatype=
"boolean"
required=
"no"
default=
"true"
>
<description>
Verify the host name in the server certificate is as expected.
</description>
...
...
src/ZEO/tests/testssl.py
View file @
fdfc9245
...
...
@@ -60,6 +60,7 @@ class SSLConfigTest(ZEOConfigTest):
certificate {}
key {}
authenticate {}
server-hostname zodb.org
</ssl>"""
.
format
(
client_cert
,
client_key
,
server_cert
))
self
.
_client_assertions
(
client
,
addr
)
client
.
close
()
...
...
@@ -200,6 +201,7 @@ class SSLConfigTest(ZEOConfigTest):
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
None
),
capath
=
here
,
check_hostname
=
True
,
)
@
mock
.
patch
(
'ssl.create_default_context'
)
...
...
@@ -215,6 +217,7 @@ class SSLConfigTest(ZEOConfigTest):
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
None
),
cafile
=
server_cert
,
check_hostname
=
True
,
)
@
mock
.
patch
(
'ssl.create_default_context'
)
...
...
@@ -231,8 +234,8 @@ class SSLConfigTest(ZEOConfigTest):
None
)
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
pwfunc
),
check_hostname
=
False
,
cafile
=
server_cert
,
check_hostname
=
True
,
)
@
mock
.
patch
(
'ssl.create_default_context'
)
...
...
@@ -259,14 +262,14 @@ class SSLConfigTest(ZEOConfigTest):
):
client
=
ssl_client
(
certificate
=
client_cert
,
key
=
client_key
,
authenticate
=
server_cert
,
check_hostname
=
Tru
e
)
check_hostname
=
Fals
e
)
context
=
ClientStorage
.
call_args
[
1
][
'ssl'
]
self
.
assertEqual
(
ClientStorage
.
call_args
[
1
][
'ssl_server_hostname'
],
None
)
self
.
assert_context
(
factory
,
context
,
(
client_cert
,
client_key
,
None
),
cafile
=
server_cert
,
check_hostname
=
Tru
e
,
check_hostname
=
Fals
e
,
)
def
args
(
*
a
,
**
kw
):
...
...
src/ZEO/zconfig.py
View file @
fdfc9245
...
...
@@ -30,9 +30,7 @@ def ssl_config(section, server):
context
.
check_hostname
=
False
return
context
context
.
check_hostname
=
bool
(
section
.
check_hostname
is
None
and
(
section
.
server_hostname
or
not
auth
)
or
section
.
check_hostname
)
context
.
check_hostname
=
section
.
check_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