HTTPSを安全に使う
TLSで暗号化されたリクエストを送信します。
「HTTPSを安全に使う」はCoddyKit上の無料Arduino & IoT Academyレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはArduino & IoT Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Arduino & IoT Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Plain HTTP Is Open
Regular HTTP sends everything in the clear. Anyone on the path can read your data, including any tokens or passwords. 🔓
HTTPS Adds Encryption
HTTPS wraps your request in TLS encryption. Snoopers see only scrambled bytes, not your readings or credentials.
It Also Proves Identity
HTTPS does more than hide data. It checks the server is the real one using a certificate, so you are not fooled by an impostor.
Use a Secure Client
On ESP32 you swap the plain client for a WiFiClientSecure. This is the object that speaks TLS for you.
#include <WiFiClientSecure.h>
WiFiClientSecure client;Point to an HTTPS URL
Pass the secure client and an https URL to begin(). The s in https is what triggers the encrypted path.
http.begin(client, "https://api.example.com/data");Trust the Right Server
To verify identity, give the client the server's root certificate. The board uses it to confirm the connection is genuine.
client.setCACert(rootCA);Avoid setInsecure
Calling setInsecure() skips certificate checks. It is handy for a quick test but unsafe for any real, shipped device.
client.setInsecure(); // testing onlyKeep the Clock Correct
Certificate checks compare dates, so your device needs the right time. Sync it with NTP or validation may fail.
TLS Costs Resources
Encryption uses extra memory and CPU. Reuse a connection where you can instead of opening a fresh TLS handshake each time.
Never Hardcode Secrets
HTTPS protects data in transit, not secrets baked into your code. Keep API keys out of plain source and out of public repos.
Default to Secure
For anything leaving your home network, prefer HTTPS. Treat plain HTTP as fine only for quick local experiments.
Quick Check
What does HTTPS give you that plain HTTP does not?
Recap
You switched to a WiFiClientSecure, used https URLs, verified the server with a root certificate, kept the clock right, and guarded your secrets. 🎉
よくある質問
「HTTPSを安全に使う」レッスンは無料ですか?
はい。「HTTPSを安全に使う」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Arduino & IoT Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Arduino & IoT Academyコースには全4レッスンが含まれています。
「HTTPSを安全に使う」で何を学びますか?
TLSで暗号化されたリクエストを送信します。 ブラウザで直接実行するハンズオンコードでArduino & IoT Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Arduino & IoT Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのArduino & IoT Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「HTTPSを安全に使う」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このArduino & IoT Academyレッスンでコードを書いて実行できますか?
はい。すべてのArduino & IoT Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- APIからGETデータを取得する
- センサー値をPOSTする
- JSONレスポンスを解析する
- HTTPSを安全に使う