WiFi and SSL handshake

Wireless communications in Waspmote, topologies, node types...
ckit
Posts: 32
Joined: Thu Nov 07, 2019 6:18 am
Company: Deakin University

WiFi and SSL handshake

Post by ckit » Fri Nov 08, 2019 5:38 am

Hi Team,

I am seen the "[WIFI] ==> ERROR CODE: Timeout" error having tried the both https (get and post) samples "WIFI_PRO_14_https_get" and "WIFI_PRO_15_https_post".
Output:

Code: Select all

J#
Start program
***************************************
Once the module is set with one or more
AP settings, it attempts to join the AP
automatically once it is powered on
Refer to example 'WIFI_PRO_01' to configure
the WiFi module with proper settings
***************************************
[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iBDRA

[WIFI] status 1
0EoCZ-----END CERTIFICATE-----I/OK
[WIFI] _command: AT+iBDRA

2. Trusted CA set OK
3. WiFi switched OFF
Setup done


[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,12,64,52)

[WIFI] port:4
[WIFI] _rate:12
[WIFI] _level:64
[WIFI] _quality:52
[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):4915
[WIFI] URL:"https://test.libelium.com:443/getpost_frame_parser.php?counter=1&varA=1&varB=2&varC=3&varE=4&varE=5"
[WIFI] URL length:101
[WIFI] _command: AT+iRLNK="https://test.libelium.com:443/getpost_frame_parser.php?counter=1&varA=1&varB=2&varC=3&varE=4&varE=5"

[WIFI] [getResponseValue] No answer
Error calling 'getURL' function
[WIFI] ==> ERROR CODE: Timeout
3. WiFi switched OFF
Certificate used in
WIFI_PRO_15_https_post
:

Code: Select all

char TRUSTED_CA[] =\ 
"-----BEGIN CERTIFICATE-----\r"\
"MIICNjCCAZ+gAwIBAgIJAL5/5O7w2Cm5MA0GCSqGSIb3DQEBCwUAMFMxLTArBgNV\r"\
"BAoMJExpYmVsaXVtIENvbXVuaWNhY2lvbmVzIERpc3RyaWJ1aWRhczELMAkGA1UE\r"\
"BhMCRVMxFTATBgNVBAMMDGxpYmVsaXVtLmNvbTAgFw0xNzAxMjQwOTU1MDJaGA8y\r"\
"MTE2MTIzMTA5NTUwMlowUzEtMCsGA1UECgwkTGliZWxpdW0gQ29tdW5pY2FjaW9u\r"\
"ZXMgRGlzdHJpYnVpZGFzMQswCQYDVQQGEwJFUzEVMBMGA1UEAwwMbGliZWxpdW0u\r"\
"Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfI9j2DbbuK1fUrH1RKmnU\r"\
"EQ22r7FAT+R7uxOhSBnx61qlLjtZT9zuA7eMuq9k3tUBSkMxJjai6ebqmvPUpgrU\r"\
"0EoCZg+PrAglcvqAkzv8QDRueEi0hLCa8iTUsuora3viKMefbFR8ROH5uQrFnZK1\r"\
"1aUQxeV0HBL9zIH8ghaLmwIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3\r"\
"DQEBCwUAA4GBAG2bWPWsfHzSqwlzY+5kJDeAgJ7GfQo51+QXqMq5nnjcPhgkIkvz\r"\
"IVOO2WM01Pnm3LuEQ3YS8eHS1blOL8i7GsxxIMR6aQ8E0XYbcizPvcyL+NAdIodd\r"\
"bSa087amkPIVcwETuGf2JdpbJLEjWayfcE1Ll+DA7UfX9korLzZzfDxX\r"\
"-----END CERTIFICATE-----";
However, I could run both http (get and post) sample which give the successful response.

Code: Select all

WiFi switched ON
WiFi is connected OK Time(ms):12560
HTTP GET OK
HTTP Time from OFF state (ms):16762

Server answer:method::GET;<br>counter::1;<br>varA::1;<br>varB::2;<br>varC::3;<br>varD::4;<br>varE::5;<br>varF::6;<br>varG::7;<br>varH::8;<br>varI::9;<br>varJ::10;<br>varK::11;<br>varL::12;<br>varM::13;<br>varN::14;<br>varO::15;<br>error::id_wasp;<br><br>
WiFi switched OFF
What could be the issue here.

Cheers
CK

ckit
Posts: 32
Joined: Thu Nov 07, 2019 6:18 am
Company: Deakin University

Re: WiFi and SSL handshake

Post by ckit » Fri Nov 08, 2019 5:47 am

Hi Team, forgot to mention Waspmote version is v15.

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: WiFi and SSL handshake

Post by libelium-dev » Fri Nov 08, 2019 11:21 am

Hi,

We think that the certificate of the example code is incorrect. Please try to use the following certificate and let us know if the problem is solved.

Code: Select all

char TRUSTED_CA[] =\ 
"-----BEGIN CERTIFICATE-----\r"\
"MIICWjCCAcOgAwIBAgIBCzANBgkqhkiG9w0BAQsFADBTMS0wKwYDVQQKDCRMaWJl\r"\
"bGl1bSBDb211bmljYWNpb25lcyBEaXN0cmlidWlkYXMxCzAJBgNVBAYTAkVTMRUw\r"\
"EwYDVQQDDAxsaWJlbGl1bS5jb20wHhcNMTcwMTI0MTAxMzA5WhcNMjcwMTIyMTAx\r"\
"MzA5WjBYMQswCQYDVQQGEwJFUzEtMCsGA1UECgwkTGliZWxpdW0gQ29tdW5pY2Fj\r"\
"aW9uZXMgRGlzdHJpYnVpZGFzMRowGAYDVQQDDBF0ZXN0LmxpYmVsaXVtLmNvbTCB\r"\
"nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAs/OnZ5/uN8iOJeNwk/7Y0PBR5p5y\r"\
"s9kGODF1VCB3kvCeGzQeieXozJVLqld0kY4/RC59n5HJX0HAjjZUhYvhAFayM9rF\r"\
"roi1REJ1dFxs2coEBn1iCrbiQonKNDFfq0HVeT4R6d0kyudCzI4u2I5H10dc6ELv\r"\
"UJ3jx0gR13toTiUCAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQU7fhrABxj\r"\
"XD3tPVEV5iaAxrmR72swCwYDVR0PBAQDAgXgMA0GCSqGSIb3DQEBCwUAA4GBACIb\r"\
"mcyvldZwYodpc1kx+1ikUlXy9Vu/2KrigMP6/aJFCskhO1eBfVv2RbZxuN1yqZDx\r"\
"qW7eiieTkRlicIFJIh//70FoznvsNqD3WpcevrNFlVWzC8V6RM3gwXwhXnAyic7u\r"\
"pzYAqu0A1aTIlCqqljSfrgUv2vK0sh/RYHNBHdeC\r"\
"-----END CERTIFICATE-----";
Regards

ckit
Posts: 32
Joined: Thu Nov 07, 2019 6:18 am
Company: Deakin University

Re: WiFi and SSL handshake

Post by ckit » Fri Nov 08, 2019 9:08 pm

Hi Team,

Thanks for the prompt reply.
I will try this on Monday when I reach the office. However, the certificate comes with the samples in Waspmote IDE for Mac OS downloaded from the following link. If the new certificate is found to be working, it is worth updating the samples and any other samples that uses TLS certificate.
WIFI_PRO_14_https_get
WIFI_PRO_15_https_post

Cheers
CK

ckit
Posts: 32
Joined: Thu Nov 07, 2019 6:18 am
Company: Deakin University

Re: WiFi and SSL handshake

Post by ckit » Mon Nov 11, 2019 2:04 am

Hi Team,

I tested the new certificate that you sent with WIFI_PRO_14_https_get sample that comes with Waspmote IDE and it failed with the same error "[WIFI] ==> ERROR CODE: Timeout".

Code: Select all

J#
Start program
***************************************
Once the module is set with one or more
AP settings, it attempts to join the AP
automatically once it is powered on
Refer to example 'WIFI_PRO_01' to configure
the WiFi module with proper settings
***************************************
[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iBDRA

[WIFI] status 1
-----END CERTIFICATE-----I/OK
[WIFI] _command: AT+iBDRA

2. Trusted CA set OK
3. WiFi switched OFF
Setup done


[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,12,46,34)

[WIFI] port:2
[WIFI] _rate:12
[WIFI] _level:46
[WIFI] _quality:34
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,12,46,34)

[WIFI] port:2
[WIFI] _rate:12
[WIFI] _level:46
[WIFI] _quality:34
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,12,46,34)

[WIFI] port:4
[WIFI] _rate:12
[WIFI] _level:46
[WIFI] _quality:34
[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):10691
[WIFI] URL:"https://test.libelium.com:443/getpost_frame_parser.php?counter=1&varA=1&varB=2&varC=3&varE=4&varE=5"
[WIFI] URL length:101
[WIFI] _command: AT+iRLNK="https://test.libelium.com:443/getpost_frame_parser.php?counter=1&varA=1&varB=2&varC=3&varE=4&varE=5"

[WIFI] [getResponseValue] No answer
Error calling 'getURL' function
[WIFI] ==> ERROR CODE: Timeout
3. WiFi switched OFF

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: WiFi and SSL handshake

Post by libelium-dev » Mon Nov 11, 2019 9:59 am

Hi,

It seems that there is a issue on our server. We are going to try to solve it as soon as posible.

Cloud you please try with another server?

Regards

ckit
Posts: 32
Joined: Thu Nov 07, 2019 6:18 am
Company: Deakin University

Re: WiFi and SSL handshake

Post by ckit » Mon Nov 11, 2019 11:16 am

Hi Team,

I tested sending GET and POST requests to your server using postman tool and it returned expected results. But the sample code provided in the Waspmote IDE always failed.

Code: Select all

[b]request:[/b]
POST https://test.libelium.com:443/getpost_frame_parser.php?
Body:
counter=1
variable1:1
name=ck

[b]response:[/b]
200 OK
method::POST;<br>POST;counter::1;<br>POST;variable1::1;<br>POST;name::ck;<br>error::id_wasp;<br><br>

Code: Select all

[b]request:[/b]
GET http://test.libelium.com/getpost_frame_parser.php?varA=1&varB=2&varC=3&varD=4&varE=5

[b]response:[/b]
200 OK
method::GET;<br>varA::1;<br>varB::2;<br>varC::3;<br>varD::4;<br>varE::5;<br>error::id_wasp;<br><br>
I didn't provide the server certificate from postman. What could be the issue?

Cheers
CK

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: WiFi and SSL handshake

Post by libelium-dev » Mon Nov 11, 2019 2:01 pm

Hi,

The server was misconfigured and it was set a Comodo CA certificate which is included by default in postman. We have just configured our certificate and now it works with the certificate set in the example codes.

Regards

ckit
Posts: 32
Joined: Thu Nov 07, 2019 6:18 am
Company: Deakin University

Re: WiFi and SSL handshake

Post by ckit » Tue Nov 12, 2019 12:57 am

Hi Team,

I am getting the same error today as well. I tried HTTPS GET sample as is and also with new certificate as well with no luck.

Code: Select all

J#
Start program
***************************************
Once the module is set with one or more
AP settings, it attempts to join the AP
automatically once it is powered on
Refer to example 'WIFI_PRO_01' to configure
the WiFi module with proper settings
***************************************
[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iBDRA

[WIFI] status 1
0EoCZg--END CERTIFICATE-----I/OK
[WIFI] _command: AT+iBDRA

2. Trusted CA set OK
3. WiFi switched OFF
Setup done


[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,12,69,57)

[WIFI] port:2
[WIFI] _rate:12
[WIFI] _level:69
[WIFI] _quality:57
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,12,69,57)

[WIFI] port:2
[WIFI] _rate:12
[WIFI] _level:69
[WIFI] _quality:57
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,12,70,58)

[WIFI] port:4
[WIFI] _rate:12
[WIFI] _level:70
[WIFI] _quality:58
[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):6174
[WIFI] URL:"https://test.libelium.com:443/getpost_frame_parser.php?counter=1&varA=1&varB=2&varC=3&varE=4&varE=5"
[WIFI] URL length:101
[WIFI] _command: AT+iRLNK="https://test.libelium.com:443/getpost_frame_parser.php?counter=1&varA=1&varB=2&varC=3&varE=4&varE=5"

[WIFI] [getResponseValue] No answer
Error calling 'getURL' function
[WIFI] ==> ERROR CODE: Timeout
3. WiFi switched OFF

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: WiFi and SSL handshake

Post by libelium-dev » Tue Nov 12, 2019 8:53 am

Hi,

Please try to perform the HTTPS request through an SSL socket. We are going to investigate more in deep what is wrong in the https examples
http://www.libelium.com/development/was ... l-sockets/

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest