# States of HTTPS libraries/firmware & cloud services

**URL:** <https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115>\
**Category:** Libraries\
**Created:** [August 6, 2017, 6:41pm UTC](https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115 "2017-08-06T18:41:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cermak](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cermak/32/14174_2.png) [@cermak](https://community.particle.io/u/cermak)\
**Post date:** [August 6, 2017, 6:41pm UTC](https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115/1 "2017-08-06T18:41:50Z")

</div>

**Native Particle data transport and encryption**

Device, cloud and webhook encryption are described in summary [here](https://community.particle.io/t/particle-and-data-security/35107/3) with a pointer to the [reference implementation](https://github.com/spark/spark-protocol).

There is no additional cost when building your project firmware. The services are there an there are several posts to incorporate webhooks to attach to various cloud service.

Searching the form will pull up a great many posts and/or [tutorials](https://docs.particle.io/tutorials/integrations/webhooks/) and there is a great deal of overlap between posts. There are plenty of solutions.

- [webhook IFTTT](https://community.particle.io/search?q=webhook%20ifttt)
- [webhook IoT](https://community.particle.io/search?q=webhook%20iot)
- [webhook MQTT](https://community.particle.io/search?q=webhook%20mqtt)

**Roll your own data transport**

There are at least three SSL/TLS libraries in various stages of porting to the Particle platform. These come at GREAT cost. There is very little room left for a custom application.

[mbedTLS](https://community.particle.io/t/tlstcpclient-library-on-webide-published/27345/34) : published as TlsTcpClient library within the WebIDE. Currently at version 0.1.15. Source: [mbedTLS](https://github.com/ARMmbed/mbedtls) Website: [mbedTLS](https://tls.mbed.org/) also known as PolarSSL and armMBED.

[wolfssl](https://community.particle.io/t/wolfssl-needs-testing-version-0-0-1-published-to-particle-cloud/34131/5): published as wolfssl currently at version 0.0.1.

[axtls](https://community.particle.io/t/axtls-library-client-testing-debugging-documenting/33889/10) : unpublished, still a work in progress.

[glowfi.sh](https://community.particle.io/t/https-client-is-here-for-the-photon-by-the-glowfi-sh-team/15934): Source: [Glowfish IO](https://github.com/glowfishAPI) Website: It looks like the website has vanished? Has this been discontinued?

All these libraries may start small ( **60-70k** ). The compiler does a great job at reducing firmware size if functions are not being **called or utilized**. As you begin to tap into more of the SSL/TLS library for encryption/decryption, the firmware size will go up. Sometimes substantially until it will no longer fit within the **128k** allowed.

**Services**

**Amazon**

The wolfssl@0.0.1 will work with [AWS IoT](https://aws.amazon.com/iot/) as demonstrated [here](https://community.particle.io/t/wolfssl-needs-testing-version-0-0-1-published-to-particle-cloud/34131/42). You have to manually construct your header and body messages and install the thing keys into the firmware.

There are several folks asking about [AWS API gateway](https://aws.amazon.com/api-gateway/). There are several forum posts about [firmware status](https://community.particle.io/search?q=AWS%20API) to support AWS API. [It turns out this is not so easy](https://community.particle.io/t/https-with-aws-api-gateway-status-reengineering/35116). I’d like to wrap this up to continue with projects below so I can get on with [other things](https://community.particle.io/t/another-greenhouse-weather-station-project-off-grid-very-custom-mqtt-node-red/32763).

**Ubidots**

I’d like to be able to get something working with the API ([https://things.ubidots.com](https://things.ubidots.com)) as to expand the Particle Ubidots 2.1.12 library to use all the available API calls. I am perfectly content at the moment pushing data back and forth via python on a BBB/RPi3.

**Losant**

It would also be nice to talk to the [losant](https://www.losant.com/) platform for MQTT/Node-Red work.

---

<div class="post-metadata">

**Author:** ![hirotakaster](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/hirotakaster/32/2223_2.png) [@hirotakaster](https://community.particle.io/u/hirotakaster)\
**Post date:** [August 7, 2017, 7:15am UTC](https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115/2 "2017-08-07T07:15:01Z")

</div>

@cermak Thank you for good summary. In addition mbedTLS can use in Apache license.

mbedTLS(TlsTcpClient) library use for server certification only now, because of this TLS library fail in calloc error(need more RAM!!) in client private rsa certification.

TlsTcpClient library maybe connect to the Amazon IoT, it would be done with very size down version TLS(cipher suite target is only Amazon IoT just one).  
But I think TLS/SSL tcp client must connect to the several TLS/SSL Servers not only Amazon IoT/Web Server. This limited TLS tcp client idea is not good.

Of course, TlsTcpClient can connect to the normal HTTPS server(Amazon API gateway or others), but it can’t use the client private certification now.

And I have a next idea, mbedTLS(TlsTcpClient) include into the Photon firmware with original build.  
But this idea is bad, because of WebIDE developer can’t use it.

I will try to develop/update mbedTLS(TlsTcpClient) for it can use the client private certification, but in basically, I think Photon ram/data size is too small for using the TLS/SSL.  
So I wish when Particle will release new hardware, it have a hardware rsa/aes acceleration and over 256k application ram area.

---

<div class="post-metadata">

**Author:** ![cermak](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cermak/32/14174_2.png) [@cermak](https://community.particle.io/u/cermak)\
**Post date:** [August 7, 2017, 7:27pm UTC](https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115/3 "2017-08-07T19:27:22Z")

</div>

> [@hirotakaster](#):
>
> So I wish when Particle will release new hardware, it have a hardware rsa/aes acceleration and over 256k application ram area.

Another way to do this is to split the library into two parts and use a pair of Particle devices. Communication between devices is your choice to do the encrypt/decrypt.

---

<div class="post-metadata">

**Author:** ![hirotakaster](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/hirotakaster/32/2223_2.png) [@hirotakaster](https://community.particle.io/u/hirotakaster)\
**Post date:** [August 8, 2017, 5:15am UTC](https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115/4 "2017-08-08T05:15:21Z")

</div>

Your idea is nice, but it will be needed a security on the two pari Particle device communication. And I think developer are hard to use split TLS library and two Particle.

---

<div class="post-metadata">

**Author:** ![timx](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/timx/32/4417_2.png) [@timx](https://community.particle.io/u/timx)\
**Post date:** [August 8, 2017, 11:14pm UTC](https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115/5 "2017-08-08T23:14:45Z")

</div>

@hirotakaster  
Have you tried:

`#define MBEDTLS_SSL_MAX_CONTENT_LEN 8192`  
or  
`#define MBEDTLS_SSL_MAX_CONTENT_LEN 12000`

It reduces the amount of RAM used by mbedtls, but at the expense of limiting the send/receive size.

---

<div class="post-metadata">

**Author:** ![hirotakaster](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/hirotakaster/32/2223_2.png) [@hirotakaster](https://community.particle.io/u/hirotakaster)\
**Post date:** [August 9, 2017, 1:04am UTC](https://community.particle.io/t/states-of-https-libraries-firmware-cloud-services/35115/6 "2017-08-09T01:04:58Z")

</div>

MBEDTLS\_SSL\_MAX\_CONTENT\_LEN optoin is no effect.
