if ui.insecureconnections:
minimumprotocol = b'tls1.0'
if not ciphers:
- ciphers = b'DEFAULT'
+ ciphers = b'DEFAULT:@SECLEVEL=0'
s[b'minimumprotocol'] = minimumprotocol
s[b'ciphers'] = ciphers
# In tests, allow insecure ciphers
# Otherwise, use the list of more secure ciphers if found in the ssl module.
if exactprotocol:
- sslcontext.set_ciphers('DEFAULT')
+ sslcontext.set_ciphers('DEFAULT:@SECLEVEL=0')
elif util.safehasattr(ssl, b'_RESTRICTED_SERVER_CIPHERS'):
sslcontext.options |= getattr(ssl, 'OP_CIPHER_SERVER_PREFERENCE', 0)
# pytype: disable=module-attr
Clients talking same TLS versions work
- $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT/
+ $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 --config hostsecurity.ciphers=DEFAULT:@SECLEVEL=0 id https://localhost:$HGPORT/
5fed3813f7f5
- $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT1/
+ $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 --config hostsecurity.ciphers=DEFAULT:@SECLEVEL=0 id https://localhost:$HGPORT1/
5fed3813f7f5
$ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/
5fed3813f7f5
The per-host config option overrides the default
$ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
- > --config hostsecurity.ciphers=DEFAULT \
+ > --config hostsecurity.ciphers=DEFAULT:@SECLEVEL=0 \
> --config hostsecurity.minimumprotocol=tls1.2 \
> --config hostsecurity.localhost:minimumprotocol=tls1.0
5fed3813f7f5