Https Server API's GET/POST on GCP


I’ve been using the HttpClient library for posting data out endpoints (http) server. New server is using Https on GCP, what HttpsClient library is currently supported for Boron? Not seeing anything current/supported when searching using Particle CLI/library search.

There is no built-in support for https on the Particle platform. The recommended method is to use webhooks.

If you must use direct https, the best TLS/SSL library is hirotakaster's library, but it's only TCP. You still need to implement HTTP on top of it. Also note that https uses a lot of data, it could use as much as a 5K per connection just for negotiation, so keep that in mind.

1 Like

Another option could be to use the Particle-Google Cloud integration.

1 Like

Incidentally, I really like the Google Cloud Platform integration. I use it at my home. It converts Particle events (Particle.publish) into GCP PubSub events.

The reason this is useful is that GCP PubSub events are queued until delivered, and have reliable delivery. And you can subscribe from behind a firewall/NAT with no network reconfiguration. It’s also secure without requiring a SSL certificate for your server.

The other advantage is that GCP PubSub has exactly once delivery. You can subscribe from multiple servers and each event will be delivered to exactly one subscriber. This is great for load-balancing and for redundancy.

While Particle SSE also allows subscription from behind firewall/NAT, GCP subscription will queue the events if the events are not received by the subscriber. Particle SSE discards the events. And if you have multiple Particle SSE listeners, the events are delivered to all of them, which requires that you handle deduplication yourself.


Yes, TlsTcpClient is just a TLS connection only, so have to implement the HTTP protocol yourself with lib.
This lib is an option when the device really wants to use TLS on its own.
In addition to the problem of TLS is verrry fat, there is also the problem of certificate handling(certificate’s expire…etc) if implements TLS/HTTPS on yourself.

As rick wrote, I would also recommend webhooks.

If I were to add something, I think the device don’t have to use HTTPS protocol on it’s self.
Because, TLS and certificates files are hard to use&handling, so if there is a lighter way, it is better for the device to use that.


How/Where would I insert the server cert in this code?

#include "httpsclient-particle/httpsclient-particle.h"

const char* host = "";
const char* path = "/your-post-path";
const char* contentType = "application/json";
const char* body = "{\"key\": \"value\"}";

void setup() {

void loop() {
  HTTPSClient client;

  if (client.connect(host)) {
    Serial.println("Connected");, contentType, body);

    Serial.print("Response code: ");

    Serial.print("Response body: ");

  } else {
    Serial.println("Connection failed");


@hirotakaster @rickkas7

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.