| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TLS (GH-13124) (GH-13253)
Modern Linux distros such as Debian Buster have default OpenSSL system
configurations that reject connections to servers with weak certificates
by default. This causes our test suite run with external networking
resources enabled to skip these tests when they encounter such a
failure.
Fixing the network servers is a separate issue.
(cherry picked from commit 2cc0223)
Changes to test_ssl.py required as 2.7 has legacy protocol tests.
The test_httplib.py change is omitted from this backport as
self-signed.pythontest.net's certificate was updated and the
test_nntplib.py change is not applicable on 2.7.
Authored-by: Gregory P. Smith greg@krypto.org
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Backport of TLS 1.3 related fixes from 3.7.
Misc fixes and workarounds for compatibility with OpenSSL 1.1.1 from git
master and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
default. Some test cases only apply to TLS 1.2.
OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
1.3. The feature is enabled by default for maximum compatibility with
broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
it to verify default options
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 2a4ee8aa01d61b6a9c8e9c65c211e61bdb471826)
|
|
|
|
|
| |
Partial backport from cb5b68abdeb1b1d56c581d5b4d647018703d61e3
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
| |
The options OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE,
OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE, OP_NO_SSLv2 (except
for PROTOCOL_SSLv2), and OP_NO_SSLv3 (except for PROTOCOL_SSLv3)
are set by default. The initial cipher suite list contains only
HIGH ciphers, no NULL ciphers and MD5 ciphers (except for PROTOCOL_SSLv2).
(cherry picked from commit 358cfd426ccc0fcd6a7940d306602138e76420ae)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10607)
Change TLS 1.3 cipher suite settings for compatibility with OpenSSL
1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by
default.
Also update multissltests to test with latest OpenSSL.
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 3e630c541b35c96bfe5619165255e559f577ee71)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL
distribution points with empty DP or URI correctly. A malicious or buggy
certificate can result into segfault.
Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue35746
(cherry picked from commit a37f52436f9aa4b9292878b72f3ff1480e2606c3)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
| |
(GH-11001) (GH-11008)
(cherry picked from commit 42b1d6127bd8595522a78a75166ebb9fba74a6a2)
(cherry picked from commit 7a2cf1e7d3bf300e98c702589d405734f4a8fcf8)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update all test certs and keys to use future proof crypto settings:
* 3072 bit RSA keys
* SHA-256 signature
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit e6dac0077996b1e1f886f036d6f2606237fa4c85)
https://bugs.python.org/issue34542
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Downstream vendors have started to deprecate weak keys. Update all RSA keys
and DH params to use at least 2048 bits.
Finite field DH param file use RFC 7919 values, generated with
certtool --get-dh-params --sec-param=high
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 88bfd0bce05043f658e50addd21366f317995e35)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
| |
Skip test_load_dh_params() of test_ssl when Python filesystem encoding
cannot encode the provided path.
|
|
|
|
|
| |
SSLContext.load_dh_params() now supports non-ASCII path.
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
| |
Debian Unstable has disabled TLS 1.0 and 1.1 for SSLv23_METHOD(). Change
TLS/SSL protocol of some tests to PROTOCOL_TLS or PROTOCOL_TLSv1_2 to
make them pass on Debian.
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-29136: Add TLS 1.3 support
TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3
cipher suites don't overlap with cipher suites from TLS 1.2 and earlier.
Since Python sets its own set of permitted ciphers, TLS 1.3 handshake
will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common
AES-GCM and ChaCha20 suites.
Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with
OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3
now.
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit cb5b68abdeb1b1d56c581d5b4d647018703d61e3)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 002d64039b60c1a9289f981fe73a5cf91d082136)
* [2.7] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297)
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 002d64039b60c1a9289f981fe73a5cf91d082136)
|
|
|
|
|
|
|
|
|
|
|
| |
OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client
could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that.
The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN
callback can pretend to not been set.
See https://github.com/openssl/openssl/pull/3158 for more details
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit a5c1bab352671e043645163ca50c5211aa657acd)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AsyncoreEchoServer of test_ssl now calls
asyncore.close_all(ignore_all=True) to ensure that
asyncore.socket_map is cleared once the test completes, even if
ConnectionHandler was not correctly unregistered.
Fix the following warning:
Warning -- asyncore.socket_map was modified by test_ssl
Before: {}
After: {6: <test.test_ssl.AsyncoreEchoServer.EchoServer.ConnectionHandler>}
(cherry picked from commit 1dae7450c68bad498e57800387b24cb103c461fa)
|
|
|
|
| |
(GH-374)
|
|
|
|
|
| |
The later value of FOO is fine. The test just needs to verify that the server
converted it to lowercase.
|
|
|
|
| |
fields in X.509 certs.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Adds a Python-2-only ssl module API and environment variable to
configure the default handling of SSL/TLS certificates for
HTTPS connections.
|
|
|
|
|
|
|
|
|
|
| |
Test test_wrong_cert() runs a server that rejects the client's certificate,
so ECONNRESET is reasonable in addition to SSLError. On the other hand, the
other three tests don't even need to run a server because they are just
testing the parsing of invalid certificate files.
This should fix intermittent failures on Windows where ECONNRESET was not
being caught.
|
|
|
|
|
|
| |
Testing for a non-existing certificate file is already done in test_errors().
The wrongcert.pem test was originally testing behaviour with a mismatched
certificate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is instead of svn.python.org, whose certificate recently expired, and
whose new certificate uses a different root certificate.
The certificate used at the pythontest server was modifed to set the "basic
constraints" CA flag. This flag seems to be required for test_get_ca_certs_
capath() to work.
Added the new self-signed certificate to capath with the following commands:
cp Lib/test/{selfsigned_pythontestdotnet.pem,capath/}
c_rehash -v Lib/test/capath/
c_rehash -v -old Lib/test/capath/
# Note the generated file names
cp Lib/test/capath/{selfsigned_pythontestdotnet.pem,0e4015b9.0}
mv Lib/test/capath/{selfsigned_pythontestdotnet.pem,ce7b8643.0}
When attempting to connect to port 444 on the new server, the resulting error
code is EHOSTUNREACH on Linux, and ETIMEDOUT on Windows.
|
| |
|
|
|
|
| |
Patch by Cédric Krier.
|
| |
|
| |
|
|
|
|
| |
values (like 0.9.8zc).
|
| |
|
| |
|
| |
|
|
|
|
|
| |
availability of the function is checked during the compilation. Patch written
by Bernard Spil.
|
|
|
|
| |
Patch by Kurt Roeckx.
|
|
|
|
|
|
| |
SNI (closes #22921)
Patch from Donald Stufft.
|
| |
|
|
|
|
|
|
| |
httplib.HTTPSConnection
This is basically a backport of issues #9003 and #22366.
|
| |
|
| |
|
|
|
|
| |
Patch by Christian Heimes and Alex Gaynor.
|
|
|
|
| |
Thanks Alex Gaynor.
|
| |
|
|
|
|
|
|
| |
protocol version in use.
Backport from default.
|
| |
|
| |
|
|
|
|
|
| |
A contribution of Alex Gaynor and David Reid with the generous support of
Rackspace. May God have mercy on their souls.
|
|
|
|
| |
Thanks to William Orr.
|