Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
b1491dfd
Commit
b1491dfd
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge pull request #103 from matrix-org/no_tls_private_key
Don't look for a TLS private key if we have set --no-tls
parents
e780492e
e49d6b15
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/config/server.py
+0
-3
0 additions, 3 deletions
synapse/config/server.py
synapse/config/tls.py
+12
-3
12 additions, 3 deletions
synapse/config/tls.py
synapse/crypto/context_factory.py
+4
-1
4 additions, 1 deletion
synapse/crypto/context_factory.py
with
16 additions
and
7 deletions
synapse/config/server.py
+
0
−
3
View file @
b1491dfd
...
@@ -30,7 +30,6 @@ class ServerConfig(Config):
...
@@ -30,7 +30,6 @@ class ServerConfig(Config):
self
.
pid_file
=
self
.
abspath
(
args
.
pid_file
)
self
.
pid_file
=
self
.
abspath
(
args
.
pid_file
)
self
.
webclient
=
True
self
.
webclient
=
True
self
.
manhole
=
args
.
manhole
self
.
manhole
=
args
.
manhole
self
.
no_tls
=
args
.
no_tls
self
.
soft_file_limit
=
args
.
soft_file_limit
self
.
soft_file_limit
=
args
.
soft_file_limit
if
not
args
.
content_addr
:
if
not
args
.
content_addr
:
...
@@ -76,8 +75,6 @@ class ServerConfig(Config):
...
@@ -76,8 +75,6 @@ class ServerConfig(Config):
server_group
.
add_argument
(
"
--content-addr
"
,
default
=
None
,
server_group
.
add_argument
(
"
--content-addr
"
,
default
=
None
,
help
=
"
The host and scheme to use for the
"
help
=
"
The host and scheme to use for the
"
"
content repository
"
)
"
content repository
"
)
server_group
.
add_argument
(
"
--no-tls
"
,
action
=
'
store_true
'
,
help
=
"
Don
'
t bind to the https port.
"
)
server_group
.
add_argument
(
"
--soft-file-limit
"
,
type
=
int
,
default
=
0
,
server_group
.
add_argument
(
"
--soft-file-limit
"
,
type
=
int
,
default
=
0
,
help
=
"
Set the soft limit on the number of
"
help
=
"
Set the soft limit on the number of
"
"
file descriptors synapse can use.
"
"
file descriptors synapse can use.
"
...
...
This diff is collapsed.
Click to expand it.
synapse/config/tls.py
+
12
−
3
View file @
b1491dfd
...
@@ -28,9 +28,16 @@ class TlsConfig(Config):
...
@@ -28,9 +28,16 @@ class TlsConfig(Config):
self
.
tls_certificate
=
self
.
read_tls_certificate
(
self
.
tls_certificate
=
self
.
read_tls_certificate
(
args
.
tls_certificate_path
args
.
tls_certificate_path
)
)
self
.
tls_private_key
=
self
.
read_tls_private_key
(
args
.
tls_private_key_path
self
.
no_tls
=
args
.
no_tls
)
if
self
.
no_tls
:
self
.
tls_private_key
=
None
else
:
self
.
tls_private_key
=
self
.
read_tls_private_key
(
args
.
tls_private_key_path
)
self
.
tls_dh_params_path
=
self
.
check_file
(
self
.
tls_dh_params_path
=
self
.
check_file
(
args
.
tls_dh_params_path
,
"
tls_dh_params
"
args
.
tls_dh_params_path
,
"
tls_dh_params
"
)
)
...
@@ -45,6 +52,8 @@ class TlsConfig(Config):
...
@@ -45,6 +52,8 @@ class TlsConfig(Config):
help
=
"
PEM encoded private key for TLS
"
)
help
=
"
PEM encoded private key for TLS
"
)
tls_group
.
add_argument
(
"
--tls-dh-params-path
"
,
tls_group
.
add_argument
(
"
--tls-dh-params-path
"
,
help
=
"
PEM dh parameters for ephemeral keys
"
)
help
=
"
PEM dh parameters for ephemeral keys
"
)
tls_group
.
add_argument
(
"
--no-tls
"
,
action
=
'
store_true
'
,
help
=
"
Don
'
t bind to the https port.
"
)
def
read_tls_certificate
(
self
,
cert_path
):
def
read_tls_certificate
(
self
,
cert_path
):
cert_pem
=
self
.
read_file
(
cert_path
,
"
tls_certificate
"
)
cert_pem
=
self
.
read_file
(
cert_path
,
"
tls_certificate
"
)
...
...
This diff is collapsed.
Click to expand it.
synapse/crypto/context_factory.py
+
4
−
1
View file @
b1491dfd
...
@@ -38,7 +38,10 @@ class ServerContextFactory(ssl.ContextFactory):
...
@@ -38,7 +38,10 @@ class ServerContextFactory(ssl.ContextFactory):
logger
.
exception
(
"
Failed to enable eliptic curve for TLS
"
)
logger
.
exception
(
"
Failed to enable eliptic curve for TLS
"
)
context
.
set_options
(
SSL
.
OP_NO_SSLv2
|
SSL
.
OP_NO_SSLv3
)
context
.
set_options
(
SSL
.
OP_NO_SSLv2
|
SSL
.
OP_NO_SSLv3
)
context
.
use_certificate
(
config
.
tls_certificate
)
context
.
use_certificate
(
config
.
tls_certificate
)
context
.
use_privatekey
(
config
.
tls_private_key
)
if
not
config
.
no_tls
:
context
.
use_privatekey
(
config
.
tls_private_key
)
context
.
load_tmp_dh
(
config
.
tls_dh_params_path
)
context
.
load_tmp_dh
(
config
.
tls_dh_params_path
)
context
.
set_cipher_list
(
"
!ADH:HIGH+kEDH:!AECDH:HIGH+kEECDH
"
)
context
.
set_cipher_list
(
"
!ADH:HIGH+kEDH:!AECDH:HIGH+kEECDH
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment