These are chat archives for esp8266/Arduino

4th
Nov 2016
hreintke
@hreintke
Nov 04 2016 08:40
I am experimenting to get async functionality within the ESP8266WebServer.
Using std:functions() as callback mechanism.
Within the callback (which is the ESP8266Webserver::handleClient) there is a yield() call.
On this call I get a panic() exception.
Is there a limitation on where/when the yield() function can be executed ?
Faraz Ahmed
@faraz117
Nov 04 2016 10:49
Has anyone successfully implementedWiFiCLientSecure . With client authentication ?
copercini
@copercini
Nov 04 2016 14:16
@faraz117 Do you fix the problem in SSLcontext in WiFiCLientSecure before load the certificates?
Faraz Ahmed
@faraz117
Nov 04 2016 14:16
Which problem ?
copercini
@copercini
Nov 04 2016 14:17
Are you loading the certificates before connect, right?
Faraz Ahmed
@faraz117
Nov 04 2016 14:17
Yes i want to load the certificates before connecting .. Certificate and the private key too
copercini
@copercini
Nov 04 2016 14:18
WiFiCLientSecure just create a SSLcontext when connect function is called
Faraz Ahmed
@faraz117
Nov 04 2016 14:18
Yes that is the problem
We can try to fix it ..
copercini
@copercini
Nov 04 2016 14:20
my poor fix to this is create the context in put
_ssl = new SSLContext;
_ssl->ref();
in bool WiFiClientSecure::loadCertificate(Stream& stream, size_t size)
and remove from int WiFiClientSecure::_connectSSL(const char* hostName)
Faraz Ahmed
@faraz117
Nov 04 2016 14:21
But how would the client.connect use this SSLContext
copercini
@copercini
Nov 04 2016 14:21
it's global
Faraz Ahmed
@faraz117
Nov 04 2016 14:22
That should fix the problem but .. i am getting error while loading private Key ..
copercini
@copercini
Nov 04 2016 14:23
Are you using DER format insted PEM?
Faraz Ahmed
@faraz117
Nov 04 2016 14:23
What format are you using to load certificate ?
I am using DER
copercini
@copercini
Nov 04 2016 14:23
me too
Faraz Ahmed
@faraz117
Nov 04 2016 14:23
the status is -269 that means INVALID_KEY
Are you able to load your files ?
copercini
@copercini
Nov 04 2016 14:24
yes
Faraz Ahmed
@faraz117
Nov 04 2016 14:24
Have you generated your files using openSSL ?
Are you loading certificate only or privateKey too ?
copercini
@copercini
Nov 04 2016 14:25
I am using from AWS
certificate, privateKey and CA file
Faraz Ahmed
@faraz117
Nov 04 2016 14:26
So you are successfully able to load all the files ?
Can you share your version of WiFiSecureClient ?
copercini
@copercini
Nov 04 2016 14:26
Yes, but in handshake the heap is gone and it doesn't works for me
but all the certificates are loaded
Faraz Ahmed
@faraz117
Nov 04 2016 14:27
Oh .. what is the key size ?
May be you could reduce the key size and that would work for you .
Can you share your version of WiFiSecureClient ?
copercini
@copercini
Nov 04 2016 14:28
yes
if you use loadCertificate first
it should work
Faraz Ahmed
@faraz117
Nov 04 2016 14:30
Alright i will try
Thanks !
copercini
@copercini
Nov 04 2016 14:30
=)
Faraz Ahmed
@faraz117
Nov 04 2016 14:47
@copercini Can you tell me the difference between setCertificate and loadCertificate ?
Are they essentially the same ... except one takes stream type and the other takes a uint8_t *
copercini
@copercini
Nov 04 2016 15:12
it deppends if you want to load using SPIFFS or a .h file
Faraz Ahmed
@faraz117
Nov 04 2016 15:13
I am using loadCertificate because i am loading from spiffs ..
How do you load using a .h file?
copercini
@copercini
Nov 04 2016 15:13
yes
Faraz Ahmed
@faraz117
Nov 04 2016 15:13
The key is still failing to load ..
I generated a key pair using openSSL .. the certificate loads but the key fails ..
Do you have details on your key pair ? the size and everything ?
copercini
@copercini
Nov 04 2016 15:15
I don't know exactly
because I am using AWS iot keys
but I can check it
Faraz Ahmed
@faraz117
Nov 04 2016 15:16
Yes please if you can check it would be great i could generate a similar pair with openSSL
copercini
@copercini
Nov 04 2016 15:19
Private-Key: (2048 bit)
Faraz Ahmed
@faraz117
Nov 04 2016 15:46
How to enable DEBUGV in WifiSecureClient
Victor Tseng
@Palatis
Nov 04 2016 15:47
build with -DDEBUG_WIFI?
or something like that
i forgot the actual macro, have to check the header and source file.
Faraz Ahmed
@faraz117
Nov 04 2016 15:47
Alright thanks
Dirk Heinke
@DirkHeinke
Nov 04 2016 16:43
Hi, maybe a bit Arduino Framework unrelated, but have you ever had the problem, that you can flash with some FTDI breakout boards and with some not? (external power supply, exact same wiring)
Faraz Ahmed
@faraz117
Nov 04 2016 18:15
Unable to use loadPrivateKey returns -269 Any ideas
-269 = SSL_KEY_INVALID