BLYNK
BLYNK.IO       πŸ“² GETTING STARTED       πŸ“— DOCS       ❓HELP CENTER       πŸ‘‰ SKETCH BUILDER

Client certificate in blynk Python for local server

Hello guys!
I am using the following code to securely connect to the my server blynk.

CERT="/home/pi/Documents/py/fullchain.pem"
blynk = blynklib.Blynk(BLYNK_AUTH, server='myhost',ssl_cert=CERT, port=9443,log=_log.info)

fullchain file matches the certificate file on the server:

server.ssl.cert = /etc/letsencrypt/live/mydomain/fullchain.pem

Also I am using a other port in server.properties:

https.port=9443

I get an error:

2021-07-21 16:36:54,216 [INFO]  Using SSL socket...
2021-07-21 16:36:55,003 [INFO]  [ERROR]: Connection with the Blynk server failed: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate (_ssl.c:1056)
Connection closed

Code from example to connect to blynk-cloud:

blynk = blynklib.Blynk(BLYNK_AUTH, port=443, ssl_cert='../certificate/blynk-cloud.com.crt', log=_log.info)

Log of my blynk server:

14:54:23.740 INFO - Reports : 0
14:54:23.741 INFO - Didn't find Let's Encrypt certificates.
14:54:23.741 INFO - Automatic certificate generation is turned ON.
14:54:23.742 INFO - Using native openSSL provider.
14:54:24.526 INFO - HTTP API and WebSockets server listening at **** port.
14:54:24.528 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
14:54:24.528 INFO - Mqtt hardware server listening at 8440 port

But in response to the request, I get:

https://mydomain:9443/token/get/V1

Let’s encryption error nope affects this. So wrote the @mstoj in the github : https://github.com/maksimstojkovic/blynk-server-setup#running-the-server

Important: Make sure that the name to the server file is correct!
Although you will receive β€˜INFO’ notices stating β€˜Didn't find Let's Encrypt certificates’ and β€˜Automatic certificate generation is turned ON’, the certificates will have been installed correctly as there are no β€˜WARN’ notices.