Skip to content

Commit 9c22a9c

Browse files
committed
Change default TLS version to 1.2 instead of 1.0.
Closes #551.
1 parent 225ab37 commit 9c22a9c

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

ChangeLog.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
v1.6.0 - 2021-xx-xx
2+
===================
3+
4+
- Changed default TLS version to 1.2 instead of 1.0.
15
- Fix incoming MQTT v5 messages with overall property length > 127 bytes being
26
incorrectly decoded. Closes #541.
37

4-
v1.5.1 - 2020x-09-22
8+
9+
v1.5.1 - 2020-09-22
510
===================
611

712
- Exceptions that occur in callbacks are no longer suppressed by default. They

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ tls_set()
291291
Configure network encryption and authentication options. Enables SSL/TLS support.
292292

293293
ca_certs
294-
a string path to the Certificate Authority certificate files that are to be treated as trusted by this client. If this is the only option given then the client will operate in a similar manner to a web browser. That is to say it will require the broker to have a certificate signed by the Certificate Authorities in ``ca_certs`` and will communicate using TLS v1, but will not attempt any form of authentication. This provides basic network encryption but may not be sufficient depending on how the broker is configured. By default, on Python 2.7.9+ or 3.4+, the default certification authority of the system is used. On older Python version this parameter is mandatory.
294+
a string path to the Certificate Authority certificate files that are to be treated as trusted by this client. If this is the only option given then the client will operate in a similar manner to a web browser. That is to say it will require the broker to have a certificate signed by the Certificate Authorities in ``ca_certs`` and will communicate using TLS v1.2, but will not attempt any form of authentication. This provides basic network encryption but may not be sufficient depending on how the broker is configured. By default, on Python 2.7.9+ or 3.4+, the default certification authority of the system is used. On older Python version this parameter is mandatory.
295295

296296
certfile, keyfile
297297
strings pointing to the PEM encoded client certificate and private keys respectively. If these arguments are not ``None`` then they will be used as client information for TLS based authentication. Support for this feature is broker dependent. Note that if either of these files in encrypted and needs a password to decrypt it, Python will ask for the password at the command line. It is not currently possible to define a callback to provide the password.
@@ -300,7 +300,7 @@ cert_reqs
300300
defines the certificate requirements that the client imposes on the broker. By default this is ``ssl.CERT_REQUIRED``, which means that the broker must provide a certificate. See the ssl pydoc for more information on this parameter.
301301

302302
tls_version
303-
specifies the version of the SSL/TLS protocol to be used. By default (if the python version supports it) the highest TLS version is detected. If unavailable, TLS v1 is used. Previous versions (all versions beginning with SSL) are possible but not recommended due to possible security problems.
303+
specifies the version of the SSL/TLS protocol to be used. By default (if the python version supports it) the highest TLS version is detected. If unavailable, TLS v1.2 is used. Previous versions (all versions beginning with SSL) are possible but not recommended due to possible security problems.
304304

305305
ciphers
306306
a string specifying which encryption ciphers are allowable for this connection, or ``None`` to use the defaults. See the ssl pydoc for more information.

src/paho/mqtt/client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def tls_set(self, ca_certs=None, certfile=None, keyfile=None, cert_reqs=None, tl
769769
option given then the client will operate in a similar manner to a web
770770
browser. That is to say it will require the broker to have a
771771
certificate signed by the Certificate Authorities in ca_certs and will
772-
communicate using TLS v1, but will not attempt any form of
772+
communicate using TLS v1,2, but will not attempt any form of
773773
authentication. This provides basic network encryption but may not be
774774
sufficient depending on how the broker is configured.
775775
By default, on Python 2.7.9+ or 3.4+, the default certification
@@ -790,9 +790,8 @@ def tls_set(self, ca_certs=None, certfile=None, keyfile=None, cert_reqs=None, tl
790790
pydoc for more information on this parameter.
791791
792792
tls_version allows the version of the SSL/TLS protocol used to be
793-
specified. By default TLS v1 is used. Previous versions (all versions
794-
beginning with SSL) are possible but not recommended due to possible
795-
security problems.
793+
specified. By default TLS v1.2 is used. Previous versions are allowed
794+
but not recommended due to possible security problems.
796795
797796
ciphers is a string specifying which encryption ciphers are allowable
798797
for this connection, or None to use the defaults. See the ssl pydoc for
@@ -812,7 +811,7 @@ def tls_set(self, ca_certs=None, certfile=None, keyfile=None, cert_reqs=None, tl
812811

813812
# Create SSLContext object
814813
if tls_version is None:
815-
tls_version = ssl.PROTOCOL_TLSv1
814+
tls_version = ssl.PROTOCOL_TLSv1_2
816815
# If the python version supports it, use highest TLS version automatically
817816
if hasattr(ssl, "PROTOCOL_TLS"):
818817
tls_version = ssl.PROTOCOL_TLS

0 commit comments

Comments
 (0)