InfraLab
HTTP-DEBUG36 cmd

HTTP/TLS デバッグ (curl / wget / openssl s_client) チート集

curl、wget、openssl s_client で HTTP ヘッダ、リダイレクト、POST、認証、TLS バージョン、証明書チェーン、有効期限、OCSP、HTTP/2/3 を調べるための実用チート集。

更新日
2026-05-29
参照範囲
公式ドキュメント / man page / 主要ベンダーCLI
対象実装
主要 Linux / BSD / ネットワーク機器 CLI の一般的な実装
免責
OS とバージョン差分は実環境で確認してください。

このチートシートの使いどころ

HTTP/TLS デバッグチートシートは、curl、wget、openssl s_client でヘッダ、リダイレクト、POST、認証、TLS、証明書チェーンを確認するための実例集です。対象は一般的な Linux/macOS/Windows の CLI と現行 HTTP/TLS 実装です。ブラウザだけでは見えないリダイレクトや TLS 終端、Cookie、CORS、HSTS の切り分けで使います。

36 / 36

curl URL

curl / wget / openssl s_client で curl URL を実務運用で使う

Example
$ curl https://example.com
curl -I

curl / wget / openssl s_client で curl -I を実務運用で使う

Example
$ curl -I https://example.com
curl -L

curl / wget / openssl s_client で curl -L を実務運用で使う

Example
$ curl -L https://example.com/redirect
curl -o

curl / wget / openssl s_client で curl -o を実務運用で使う

Example
$ curl -o index.html https://example.com
curl -X POST -d

curl / wget / openssl s_client で curl -X POST -d を実務運用で使う

Example
$ curl -X POST -d "name=alice" https://api.example.com/users
curl --data-urlencode

curl / wget / openssl s_client で curl --data-urlencode を実務運用で使う

Example
$ curl -G --data-urlencode "q=日本語" https://example.com/search
curl -F

curl / wget / openssl s_client で curl -F を実務運用で使う

Example
$ curl -F "file=@report.txt" https://api.example.com/upload
curl -u

curl / wget / openssl s_client で curl -u を実務運用で使う

Example
$ curl -u user:pass https://example.com/basic
curl -H

curl / wget / openssl s_client で curl -H を実務運用で使う

Example
$ curl -H "Authorization: Bearer TOKEN" https://api.example.com
curl cookie

curl / wget / openssl s_client で curl cookie を実務運用で使う

Example
$ curl -b cookies.txt -c cookies.txt https://example.com
curl --compressed

curl / wget / openssl s_client で curl --compressed を実務運用で使う

Example
$ curl --compressed https://example.com
curl --resolve

curl / wget / openssl s_client で curl --resolve を実務運用で使う

Example
$ curl --resolve example.com:443:203.0.113.10 https://example.com
curl -v

curl / wget / openssl s_client で curl -v を実務運用で使う

Example
$ curl -v https://example.com
curl --trace-time

curl / wget / openssl s_client で curl --trace-time を実務運用で使う

Example
$ curl --trace-time --trace-ascii /tmp/trace.txt https://example.com
curl -w time

curl / wget / openssl s_client で curl -w time を実務運用で使う

Example
$ curl -o /dev/null -s -w "%{time_total}\n" https://example.com
curl --http2

curl / wget / openssl s_client で curl --http2 を実務運用で使う

Example
$ curl --http2 -I https://example.com
curl --http3

curl / wget / openssl s_client で curl --http3 を実務運用で使う

Example
$ curl --http3 -I https://example.com
curl -k

curl / wget / openssl s_client で curl -k を実務運用で使う

Example
$ curl -k https://selfsigned.example.com
curl --cacert

curl / wget / openssl s_client で curl --cacert を実務運用で使う

Example
$ curl --cacert ca.pem https://internal.example.com
curl --cert-status

curl / wget / openssl s_client で curl --cert-status を実務運用で使う

Example
$ curl --cert-status https://example.com
curl --tls-max

curl / wget / openssl s_client で curl --tls-max を実務運用で使う

Example
$ curl --tls-max 1.3 https://example.com
wget URL

curl / wget / openssl s_client で wget URL を実務運用で使う

Example
$ wget https://example.com/file.tar.gz
wget -O

curl / wget / openssl s_client で wget -O を実務運用で使う

Example
$ wget -O latest.tgz https://example.com/file.tar.gz
wget -m

curl / wget / openssl s_client で wget -m を実務運用で使う

Example
$ wget -m -np https://example.com/docs/
wget -N

curl / wget / openssl s_client で wget -N を実務運用で使う

Example
$ wget -N https://example.com/file.tar.gz
wget --load-cookies

curl / wget / openssl s_client で wget --load-cookies を実務運用で使う

Example
$ wget --load-cookies cookies.txt https://example.com/private
wget --spider

curl / wget / openssl s_client で wget --spider を実務運用で使う

Example
$ wget --spider https://example.com/health
wget --header

curl / wget / openssl s_client で wget --header を実務運用で使う

Example
$ wget --header="Authorization: Bearer TOKEN" https://api.example.com
openssl s_client connect

curl / wget / openssl s_client で openssl s_client connect を実務運用で使う

Example
$ openssl s_client -connect example.com:443 -servername example.com < /dev/null
openssl s_client showcerts

curl / wget / openssl s_client で openssl s_client showcerts を実務運用で使う

Example
$ openssl s_client -connect example.com:443 -servername example.com -showcerts < /dev/null
openssl s_client tls1_3

curl / wget / openssl s_client で openssl s_client tls1_3 を実務運用で使う

Example
$ openssl s_client -connect example.com:443 -servername example.com -tls1_3 < /dev/null
openssl s_client cipher

curl / wget / openssl s_client で openssl s_client cipher を実務運用で使う

Example
$ openssl s_client -connect example.com:443 -servername example.com -cipher ECDHE < /dev/null
openssl x509 text

curl / wget / openssl s_client で openssl x509 text を実務運用で使う

Example
$ openssl x509 -in cert.pem -text -noout
openssl x509 dates

curl / wget / openssl s_client で openssl x509 dates を実務運用で使う

Example
$ openssl s_client -connect example.com:443 -servername example.com < /dev/null 2>/dev/null | openssl x509 -noout -dates
openssl x509 issuer

curl / wget / openssl s_client で openssl x509 issuer を実務運用で使う

Example
$ openssl x509 -in cert.pem -noout -issuer -subject
openssl verify

curl / wget / openssl s_client で openssl verify を実務運用で使う

Example
$ openssl verify -CAfile ca.pem cert.pem
対応ツール
Related