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

    SSL Connection IPProto_SEC Error SiPy

    Scheduled Pinned Locked Moved SiPy
    websocketsipy
    5 Posts 2 Posters 1.9k 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.
    • L Offline
      Lokefar
      last edited by

      Re: SSL connection IPProto_SEC error

      Been trying to get this lib to work: https://github.com/Enabling/wipy-urllib/tree/master

      But I get the same error as in the older forum entry:

      AttributeError: 'module' object has no attribute 'IPPROTO_SEC'
      

      And as fare as I can read on the Git the code below is only for the WiPy 1

      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
      

      Any idea how to re-write the library to take this into account? Am using an SiPy.

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @Lokefar
        last edited by

        @Lokefar
        you can wrap socket by ssl
        https://docs.pycom.io/pycom_esp32/library/ussl.html?highlight=ssl

        this is good start point for conversion

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • L Offline
          Lokefar
          last edited by

          @livius Thanks. I was already having a look at that but my initial thought is that it is a bit beyond my comprehension ability to convert it.

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @Lokefar
            last edited by

            @Lokefar
            instead of:

            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)
                        sock.settimeout(5)
                        s = ssl.wrap_socket(sock)
            s.connect(socket.getaddrinfo(host, port)[0][4])
            

            do (not tested but should be something simmilar)

            sock = socket.socket()
            s = ssl.wrap_socket(sock)
            s.connect(socket.getaddrinfo(host, port)[0][-1])
            

            think about people first, then computers

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              Lokefar @livius
              last edited by

              @livius Did a quick try. Got the following error:

              Traceback (most recent call last):
                File "<stdin>", line 1, in <module>
                File "/flash/lib/urequests.py", line 141, in urlopen
                File "/flash/lib/urequests.py", line 38, in __init__
              OSError: -32512
              

              Will look more into it later, but as fare as I can Google it might have something to do with the antenna transmission.

              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