summaryrefslogtreecommitdiffstatshomepage
path: root/docs/wipy
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-04-16 09:41:32 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-04-16 09:41:32 +0300
commitac8843ceecb645b11737ea42d0f4248d742383cd (patch)
treef330027b34ad7206420c6c0cd90bf470df2c7e6c /docs/wipy
parenta0fb360f1b3f32131be6267c7ce0dbe74ed91f77 (diff)
downloadmicropython-ac8843ceecb645b11737ea42d0f4248d742383cd.tar.gz
micropython-ac8843ceecb645b11737ea42d0f4248d742383cd.zip
docs/library/ussl: Deconditionalize, wipy notes moved to its documentation.
Diffstat (limited to 'docs/wipy')
-rw-r--r--docs/wipy/general.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/wipy/general.rst b/docs/wipy/general.rst
index eca9bbe459..024f789660 100644
--- a/docs/wipy/general.rst
+++ b/docs/wipy/general.rst
@@ -254,6 +254,29 @@ SSL sockets need to be created the following way before wrapping them with.
s = socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
ss = ssl.wrap_socket(s)
+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
+FTP server, and they must be placed in specific paths with specific names.
+
+- The certificate to validate the other side goes in: **'/flash/cert/ca.pem'**
+- The certificate to authenticate ourselves goes in: **'/flash/cert/cert.pem'**
+- The key for our own certificate goes in: **'/flash/cert/private.key'**
+
+.. note::
+
+ When these files are stored, they are placed inside the internal **hidden** file system
+ (just like firmware updates), and therefore they are never visible.
+
+For instance to connect to the Blynk servers using certificates, take the file ``ca.pem`` located
+in the `blynk examples folder <https://github.com/wipy/wipy/tree/master/examples/blynk>`_.
+and put it in '/flash/cert/'. Then do::
+
+ import socket
+ 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][-1])
+
Incompatibilities in uhashlib module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~