failing to wrap socket.

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Knoahlr
Posts: 7
Joined: Wed Nov 16, 2016 11:37 pm

SOCKET Variable

Post by Knoahlr » Wed Nov 16, 2016 11:40 pm

Was the socket.IPPROTO_SEC variable removed from Micropython 1.8, since most examples online have it. If not, is there any way I could get the variable, without having to rebuild the whole firmware?

Knoahlr
Posts: 7
Joined: Wed Nov 16, 2016 11:37 pm

failing to wrap socket.

Post by Knoahlr » Wed Nov 16, 2016 11:59 pm

>>> sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> import ussl as ssl
>>> s=ssl.wrap_socket(sock)
ssl_handshake_status: -256
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 5] EIO

Running this on the Esp8266 NodeMCU and Micropython Version 1.8.6
Last edited by Knoahlr on Wed Nov 16, 2016 11:59 pm, edited 1 time in total.

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: SOCKET Variable

Post by platforma » Thu Nov 17, 2016 9:31 am

I might be wrong, but IPPROTO_SEC is available for WiPy. Which "most" examples are you referring to and what board are you using?
http://docs.micropython.org/en/latest/w ... pproto_sec

Knoahlr
Posts: 7
Joined: Wed Nov 16, 2016 11:37 pm

Re: SOCKET Variable

Post by Knoahlr » Thu Nov 17, 2016 2:15 pm

You're right, I'm using the esp8266 Node MCU and used examples for the Wipy. I was trying to use ssl to wrap a socket and kept getting an "ssl_handshake_error:-256" I thought this was the error.


Sent from my SM-G930W8 using Tapatalk

Knoahlr
Posts: 7
Joined: Wed Nov 16, 2016 11:37 pm

Ssl module that validates server certificates

Post by Knoahlr » Thu Nov 17, 2016 4:26 pm

I'm currently unable to post data to secure "company" sites for a project I'm doing and this is because the ssl handshake fails.
I believe the reason to be because the current ussl module doesn't Validate server certificates.

Is there any ssl.wrap.socket () out there that does this?
I`m running the esp8266 NodeMCU with Micropython V1.8.6
">>ssl_handshake_status:-256"
Thank you in advance.

Sent from my SM-G930W8 using Tapatalk

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: failing to wrap socket.

Post by deshipu » Thu Nov 17, 2016 4:35 pm

Can you also include the version of MicroPython that you are using and the board on which you are running it?

Knoahlr
Posts: 7
Joined: Wed Nov 16, 2016 11:37 pm

Re: RE: Re: failing to wrap socket.

Post by Knoahlr » Thu Nov 17, 2016 4:54 pm

deshipu wrote:Can you also include the version of MicroPython that you are using and the board on which you are running it?
Done

Sent from my SM-G930W8 using Tapatalk

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: SOCKET Variable

Post by platforma » Fri Nov 18, 2016 9:46 am

This is, indeed, an error, I am going to merge your two topics together and move it to the esp8266 category.
Please don't cross-post and don't create multiple topics for the same issue.

Post Reply