summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library/ussl.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/library/ussl.rst')
-rw-r--r--docs/library/ussl.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/library/ussl.rst b/docs/library/ussl.rst
index 60be894107..b66e23b2c8 100644
--- a/docs/library/ussl.rst
+++ b/docs/library/ussl.rst
@@ -21,7 +21,7 @@ Functions
import ssl
s = socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
ss = ssl.wrap_socket(s)
- ss.connect(socket.getaddrinfo('www.google.com', 443)[0][4])
+ ss.connect(socket.getaddrinfo('www.google.com', 443)[0][-1])
Certificates must be used in order to validate the other side of the connection, and also to
authenticate ourselves with the other end. Such certificates must be stored as files using the
@@ -44,7 +44,7 @@ Functions
import ssl
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
ss = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs='/flash/cert/ca.pem')
- ss.connect(socket.getaddrinfo('cloud.blynk.cc', 8441)[0][4])
+ ss.connect(socket.getaddrinfo('cloud.blynk.cc', 8441)[0][-1])
SSL sockets inherit all methods and from the standard sockets, see the :mod:`usocket` module.