-
Notifications
You must be signed in to change notification settings - Fork 45
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
cannot get SSL connections to work #12
Comments
Hi @eikaramba, The example is working for me, what version of the library are you using? Have you tried any other HTTPS servers? The root certs the library is bundled with can be found here: https://github.com/arduino-libraries/MKRNB/blob/master/src/utility/NBRootCerts.h |
I tried multiple different ssl domains. currently testing with https://webhook.site (using letsencrypt certificate with DST X3 root certificate https://letsencrypt.org/certificates/), and again it works when i'm using port 80 and NBClient(you can call that site with or without ssl), but not if i'm switching to 443 and NBSSLClient. The behaviour is always like this:
So you see it is basically not doing anything anymore after the GET command. If i do the SAME exact code and now just change port to 80 and use the non ssl lib, it works.
Also it seems to be much faster. Do you have any idea what is going on here? I even tried to use the RAW AT commands inspired by this script here (https://github.com/telstra/arduino-mkr-nb-1500-cumulocity/blob/master/send_measurements/send_measurements.ino). Not working as well unfortunately. Also by using AT commands i was able to confirm that your library is actually successfully loading the root certificats into the modem. I'm using the latest versions of everything as of today. Really glad for every tip you can give. Some more debug infos:
|
If you change the What I suspect is happening is the SSL connection is failing and @cmaglie @facchinm I'll prepare a pull request to change the return value to 0 on failure. |
Please ignore my previous comment, as it only applies to the MKR GSM lib. @eikaramba if you can provide some debug logs as I indicated above that would be great. |
@eikaramba I've tried the following sketch on two of my boards, and all looks fine:
Here's the output on the Serial monitor:
|
thanks for your help. i activated the debug mode and got the following. seems there is a problem with connecting to the server via socket?
For comparison i tried the same without SSL and got this:
|
This log looks perfectly ok, to me:
^ indicates a successful connection
^ indicates a HTTP response from the server. |
@sandeepmistry please have a look again. i posted 2 logs, one with ssl and one without. the one that worked was without ssl.
at the end |
Hi @eikaramba, Sorry, I missed it ... A few questions for you:
|
Yes exactly. It's the exact same code apart from the different domain. |
Hmm, so it might be either of:
Some suggestions: |
i finally had more time to debug this, but unfortunately it is still not working.
this gives me the time since the device powered on(here 16 seconds). Is that right? I don't think so. but how can i "reset" or "set" the time? the example with the ntp udp packet to get the time resulted in that:
|
i tried to manually send the http call via the http ubox module https://www.u-blox.com/sites/default/files/SARA-R4_ATCommands_%28UBX-17003787%29.pdf#%5B%7B%22num%22%3A694%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C59.527%2C742.677%2Cnull%5D
However this gives the following http error state
Looking at the manual this indicated an "internal error" in the HTTP Protocol |
Do you have any solution for this yet? |
unfortunately i have given up. i really tried everything even tried to call all the AT commands manually myself etc. but i never got SSL working. at the end i create a http proxy on my server which basically handles the ssl handshake. |
First of all, it looks like you are not getting the proper time from the cell network! It's outputting a date in 1980. This is probably messing a whole bunch of things up. There are 2 things I would try...
|
Any method for adding a new root cert? I tried getting the cert with openssl s_client connect command. I took text between begin/end signature, decoded base64 and then put resulting hex and length in the header file. Sadly when it comes time to load the cert it fails. |
For updating new SSl certificate i made a tutorial on the MKRGSM that is easely portable onto the MKRNB (you just need to change the type of client to the one you usually use, here is the topic (see 2nd comment for the tutorial) arduino-libraries/MKRGSM#151 |
I'm starting to really hate Arduino MKR series ... very little support, almost all the library's have flaws and bugs. It's been incredibly painful just to get this board to behave itself. |
Is there any documentation about connecting to SSL websites?
If i try the example from https://www.arduino.cc/en/Tutorial/MKRNBExamplesNBSSLWebClient it does not send the request. It works with http, but i tried several different ssl requests and ssl never works.
00:40:03.016 -> connecting...
00:40:23.535 -> connected
The text was updated successfully, but these errors were encountered: