{"id":23469837,"url":"https://github.com/bulba-man/esp8266-pubsubclient-secure","last_synced_at":"2026-04-17T01:32:16.742Z","repository":{"id":92399625,"uuid":"179512246","full_name":"bulba-man/ESP8266-PubSubClient-Secure","owner":"bulba-man","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-11T12:53:11.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T07:13:10.039Z","etag":null,"topics":["arduino","esp8266","mqtt","tls"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bulba-man.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-04T14:18:42.000Z","updated_at":"2019-04-11T12:53:13.000Z","dependencies_parsed_at":"2023-06-26T01:42:18.373Z","dependency_job_id":null,"html_url":"https://github.com/bulba-man/ESP8266-PubSubClient-Secure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bulba-man/ESP8266-PubSubClient-Secure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulba-man%2FESP8266-PubSubClient-Secure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulba-man%2FESP8266-PubSubClient-Secure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulba-man%2FESP8266-PubSubClient-Secure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulba-man%2FESP8266-PubSubClient-Secure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bulba-man","download_url":"https://codeload.github.com/bulba-man/ESP8266-PubSubClient-Secure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulba-man%2FESP8266-PubSubClient-Secure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31911478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","esp8266","mqtt","tls"],"created_at":"2024-12-24T15:34:21.488Z","updated_at":"2026-04-17T01:32:16.720Z","avatar_url":"https://github.com/bulba-man.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP8266-PubSubClient-Secure\n\nOn the Internet, there are many examples of implementing secure connections for MQTT, but they are all outdated.\n\nI took the liberty of writing a few examples for modern libraries.\n\n- **[ESP8266 Arduino core](https://github.com/esp8266/Arduino \"ESP8266 Arduino core\")** *ver* 2.5.0\n- **[PubSubClient](https://github.com/knolleary/pubsubclient \"PubSubClient\")** *ver* 2.7\n- **[ArduinoJson](https://github.com/bblanchon/ArduinoJson \"ArduinoJson\")** *ver* 6.10.0\n\n## Generate Certificates\n\nI suggest to generate certificates by myself using the [openssl](https://www.openssl.org/) utility. You can also use other certificates.\n\nFirst of all, we need to generate a self-signed CA certificate.\n##### Generate Key for CA:\n```bash\nopenssl genrsa -out rootCA.key 2048\n```\n##### Generate self-signed CA Certificate:\n```bash\nopenssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem\n```\n\nNow we generate a certificate for the client, i.e. of our device.\n\n\u003e **Note**: for each device you need to generate a separate key-certificate pair and sign them with a CA certificate\n\n##### Generate private key for the client:\n```bash\nopenssl genrsa -out client.key 2048\n```\n##### Request for Certificate Signing Request (CSR) to generate client certificate:\n```bash\nopenssl req -new -key client.key -out client.csr\n```\n##### Generate Client Certificate:\n```bash\nopenssl x509 -req -in client.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out client.pem -days 500 -sha256\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulba-man%2Fesp8266-pubsubclient-secure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbulba-man%2Fesp8266-pubsubclient-secure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulba-man%2Fesp8266-pubsubclient-secure/lists"}