• [solved] MQTT and tls

    MicroPython mqtt tls ssl
    9
    1 Votes
    9 Posts
    1k Views
    M
    Just want to share actual working sample. NOTE: Checking server certificate is DISABLED in this case. You need CERT_REQUIRED or CERT_REQUIRED judging from documentation. But, by some reason in my build ussl.CERT_REQUIRED gave "...object has no attribute...". # --------------------------------------------- # Tested setup: # - Traefik Proxy 2.5 (Let's Encrypt Cert) # - Mosquitto 2.0.16 # - MicroPython 1.17 # ---------------------------------------------- from umqtt.simple import MQTTClient HOST = "<HOST>" # Without server_hostname it wan't connect (by some reason) ssl_params = {"server_hostname": HOST} c = MQTTClient("<client_id>", server=HOST, port=8883, user="<username>", password="<password>", # Need keepalive > 0 or got MqttException(2) keepalive=10, ssl=True, ssl_params=ssl_params)
  • Issue with ssl.wrap_socket()

    Discussion ssl
    1
    0 Votes
    1 Posts
    592 Views
    No one has replied
  • Restrict TLS to V1.2 only

    FiPy fipy ussl ssl tls
    1
    0 Votes
    1 Posts
    547 Views
    No one has replied
  • SiPy -> AWS Device Example - CA file not found

    SiPy sipy aws example ssl
    5
    1
    0 Votes
    5 Posts
    2k Views
    sebS
    @jonnyboy said in SiPy -> AWS Device Example - CA file not found: CA file not found Can you try formatting the file system and re-uploading the files again, you can do this by running the following from the REPL: import os os.mkfs('/flash') It could be the the file system has become corrupt, it might be worth trying to upload the files via USB if at all possible.
  • 0 Votes
    19 Posts
    6k Views
    L
    @sunrise17 you must modify esp_get_revision - i do not have guide but on the forum you can find such posted by @robert-hh https://forum.pycom.io/post/13828
  • LoPy HTTP POST request: OSError!

    LoPy http post oserror ssl lopy urequest.py
    11
    0 Votes
    11 Posts
    3k Views
    V
    Same problem happened to me. @ahmedkalnaggar solution solved, memory is not being freed properly.
  • SSL socket fails with OSError: -30592

    WiPy 2&3 ssl sockets secure tsl
    6
    0 Votes
    6 Posts
    2k Views
    D
    @this-wiederkehr I think it the same way as you do. There is no parameter named as server_hostname in the docs.
  • Kernel Panic when using SSL connections (MQTT or HTTPS)

    LoPy ssl mqtt https
    6
    0 Votes
    6 Posts
    2k Views
    T
    @aktivalux said in Kernel Panic when using SSL connections (MQTT or HTTPS): -35123 You mean it raises OSError: -35123? Actually -35123 beeing -0x8933 is out of the error range defined by mbedtls. Is there a typo in this numer? https://tls.mbed.org/api/error_8h.html
  • Using MQTT with SSL on Lopy

    LoPy mqtt ssl
    4
    0 Votes
    4 Posts
    2k Views
    G
    @sakis said in Using MQTT with SSL on Lopy: ssl_params is a dict. You shouldn't use = to assign values to dict keys, but : Also, a key should be a valid Python type (in this case str I guess): ssl_params= {'cert_reqs':ssl.CERT_REQUIRED, 'ca_certs':'pycom/ca.pem'} https://docs.python.org/3/tutorial/datastructures.html#dictionaries More on...Python dictionary
  • How to make HTTPS requests

    LoPy lopy https ssl sockets
    7
    0 Votes
    7 Posts
    3k Views
    D
    Does it work reliably if repeated for hundreds of requests? Properly raised exceptions are acceptable in my opinion.
  • WiPy HTTPS call

    WiPy 2&3 ssl wipy2.0
    7
    0 Votes
    7 Posts
    3k Views
    I
    I have the same problem: https://forum.pycom.io/topic/1056/ssl-socket-communication-between-wipy-2-0 But if I try to connect with the wipy to a secure Server with ssl #client side import usocket as socket import ssl from network import WLAN import machine wlan = WLAN(mode=WLAN.STA) wlan.connect('TP-LINK_2.4GHz_E113DF', auth=(WLAN.WPA2,"***********")) while not wlan.isconnected(): machine.idle() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) # Require a certificate from the server. We used a self-signed certificate # so here ca_certs must be the server certificate itself. ssl_sock = ssl.wrap_socket(s,cert_reqs=ssl.CERT_REQUIRED,ca_certs='cert.pem') ssl_sock.connect(('192.168.1.125', 10023)) ssl_sock.write(b"boo!") data = ssl_sock.read() print(data) ssl_sock.close() It works without problems. Try to use: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) instead of s = socket.socket() But if I try to set a WiPy as a Server, I receive a Guru Meditation Error. More datails are in the topic linked early.
  • 1 Votes
    6 Posts
    2k Views
    T
    if the error code changes it certainly is another error. No clue what -1 means, sorry.
  • SSL Socket Server Side on WiPy 2.0

    WiPy 2&3 wipy 2.0 ssl socket server
    3
    2
    1 Votes
    3 Posts
    1k Views
    C
    @Innocenzo did you solve the problem?
  • UMQTT & AWS IoT

    Guides mqtt micropython aws umqtt ssl
    5
    5 Votes
    5 Posts
    4k Views
    F
    Hello, i am trying very hard to subscribe to a topic and actually receive something. I am using the integrated client on the AWS side to debug. i am observing that i am successful when it comes to publishing topics. It works well. If i subscribe to a topic i just do not receive anything at all. I have tried with both simple and the guide in the pycom documentation. I suspect at this point a misconfiguration from the side of AWS. I have permission in my policy to subscribe to any resource. Subscription itself works. No messages are ever displayed though. Callback is never called. any help is appreciated!