Skip to content

AttributeError: 'socket' object has no attribute 'setsockopt' (TLS) #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anecdata opened this issue Mar 27, 2024 · 1 comment · Fixed by #157
Closed

AttributeError: 'socket' object has no attribute 'setsockopt' (TLS) #155

anecdata opened this issue Mar 27, 2024 · 1 comment · Fixed by #157

Comments

@anecdata
Copy link
Member

When trying to set up a TLS TCP server on WIZnet using
adafruit/circuitpython#8954
+
https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/tree/core-compatible-socket-type-numbers

ss = ssl_context.wrap_socket(s, server_side=True)
results in
AttributeError: 'socket' object has no attribute 'setsockopt'

@anecdata
Copy link
Member Author

anecdata commented Mar 27, 2024

Looks like this applies to TLS clients now too. sockopt was implemented in adafruit/circuitpython@e5f0579 on 3/25, but the 3/21 artifacts will still run TLS clients on WIZnet:
https://github.com/adafruit/circuitpython/actions/runs/8380440828

But something else is going on with TLS server using 3/21 artifacts:

Accepting connections (mem=1977744)
Traceback (most recent call last):
  File "code.py", line 63, in <module>
OSError: [Errno 22] Invalid argument

Code done running.
MemoryError: 
MemoryError: 

Press any key to enter the REPL. Use CTRL-D to reload.

line 63 is the accept():

    print(f"Accepting connections (mem={gc.mem_free()})")
    conn, addr = ss.accept()

@anecdata anecdata changed the title AttributeError: 'socket' object has no attribute 'setsockopt' (TLS server) AttributeError: 'socket' object has no attribute 'setsockopt' Mar 27, 2024
@anecdata anecdata changed the title AttributeError: 'socket' object has no attribute 'setsockopt' AttributeError: 'socket' object has no attribute 'setsockopt' (TLS) Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant