0
我有這個python代碼,從套接字和打印到控制檯獲取數據。但在工作過程中,我得到這個錯誤代碼如何解決與ssl.socket問題
Traceback (most recent call last):
File "server.py", line 1, in <module>
import ssl, socket
File "/home/ssl.py", line 20, in <module>
returned from time.time())
AttributeError: 'module' object has no attribute 'wrap_socket'
也許有人有任何想法我可以解決這個問題?
import ssl, socket
sock = ssl.wrap_socket(socket.socket(), 'server.key', 'server.crt', True)
sock.bind(('', 443))
sock.listen(10)
while True:
conn, addr = sock.accept()
data = conn.recv(4)
print data
謝謝