Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    OSError: [Errno -29312] MBEDTLS_ERR_SSL_CONN_EOF

    Scheduled Pinned Locked Moved GPy
    2 Posts 2 Posters 35 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K Offline
      kjm
      last edited by

      There is this line in urequests

      s=socket.socket(); s.connect(ai); s=ssl.wrap_socket(s, server_hostname=host)
      

      that has been working great with multiple programs for over a year now. Recently, after a few trivial changes unrelated to urequest calls in the calling progam, it has started throwing OSError: [Errno -29312] MBEDTLS_ERR_SSL_CONN_EOF. The main program makes multiple calls to requests & it's always the last one that has the error, the others work fine.

      https://stackoverflow.com/questions/51160692/esp32-micropython-ssl-websocket suggests inserting import gc; gc.collect() a few lines above the wrap_sockets line after the dns lookup but that hasn't fixed it.

      I'd be grateful for some suggestions on what to try next.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @kjm
        last edited by

        @kjm that error normally means that the remote server shut down the connection.

        Are all your calls to the same server? Do you get the same result if you do the calls independently or reorder them? What do curl or openssl s_client say when performing the same request(s)?

        Make sure you log the actual request being sent (full URL including protocol, host, port, path, query, as well as method, headers, body sent if relevant...) and double check that it all matches what you expect.

        If you can, it would be interesting to capture the relevant traffic (on the server or an intermediate router) to see what exactly is sent by the server.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post

        Pycom on Twitter

        Pycom