{"id":1925,"date":"2026-08-06T14:33:48","date_gmt":"2026-08-06T05:33:48","guid":{"rendered":"https:\/\/clouds.tokyo\/blog\/?p=1925"},"modified":"2026-08-06T14:34:39","modified_gmt":"2026-08-06T05:34:39","slug":"file_get_contents_ssl_error","status":"publish","type":"post","link":"https:\/\/clouds.tokyo\/blog\/file_get_contents_ssl_error\/","title":{"rendered":"\u3010PHP\u3011file_get_contents\u3067SSL\u8a3c\u660e\u66f8\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3089"},"content":{"rendered":"<p>file_get_contents\u3067SSL\u8a3c\u660e\u66f8\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3089\u3001<br \/>\n\u4e2d\u9593\u8a3c\u660e\u66f8\u304c\u6b63\u3057\u304f\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b63\u3057\u3044\u5bfe\u7b56\u306f<br \/>\n\u30fb\u76f8\u624b\u306e\u30b5\u30fc\u30d0\u30fc\u306e\u4e2d\u9593\u8a3c\u660e\u66f8\u3092\u6b63\u3057\u304f\u8a2d\u5b9a\u3059\u308b<br \/>\n\u3042\u308b\u3044\u306f<br \/>\n\u30fbcurl\u3092\u4f7f\u3063\u3066\u4e2d\u9593\u8a3c\u660e\u66f8\u3092\u3053\u3061\u3089\u3067\u88dc\u5b8c\u3059\u308b<\/p>\n<p>\u9762\u5012\u306a\u6642\u306f\u3001SSL\u8a3c\u660e\u66f8\u306e\u691c\u8a3c\u3092\u884c\u308f\u306a\u3044\u30aa\u30d7\u30b7\u30e7\u30f3\u3092file_get_contents\u306b\u6e21\u3059\u3060\u3051\u3067\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\r\n\/\/ SSL\u691c\u8a3c\u3092\u7121\u52b9\u5316\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\r\n$options = [\r\n    \"ssl\" => [\r\n        \"verify_peer\" => false,\r\n        \"verify_peer_name\" => false,\r\n    ]\r\n];\r\n\r\n\/\/ \u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3001file_get_contents \u306b\u6e21\u3059\r\n$context = stream_context_create($options);\r\n$response = file_get_contents(\"https:\/\/\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306eURL\", false, $context);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>file_get_contents\u3067SSL\u8a3c\u660e\u66f8\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3089\u3001 \u4e2d\u9593\u8a3c\u660e\u66f8\u304c\u6b63\u3057\u304f\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u6b63\u3057\u3044\u5bfe\u7b56\u306f \u30fb\u76f8\u624b\u306e\u30b5\u30fc\u30d0\u30fc\u306e\u4e2d\u9593\u8a3c\u660e\u66f8\u3092\u6b63\u3057\u304f\u8a2d\u5b9a\u3059\u308b \u3042\u308b\u3044\u306f \u30fbcurl\u3092\u4f7f\u3063\u3066\u4e2d\u9593\u8a3c\u660e\u66f8\u3092 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/clouds.tokyo\/blog\/file_get_contents_ssl_error\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010PHP\u3011file_get_contents\u3067SSL\u8a3c\u660e\u66f8\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3089&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":""},"categories":[2],"tags":[119,189,373],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pezW3u-v3","jetpack-related-posts":[{"id":937,"url":"https:\/\/clouds.tokyo\/blog\/linux_ssl_revoke\/","url_meta":{"origin":1925,"position":0},"title":"\u3010Linux\u3011Let&#8217;s Encrypt\u3067\u53d6\u5f97\u3057\u305f\u8a3c\u660e\u66f8\u3092\u524a\u9664\u3057\u3066\u66f4\u65b0\u5bfe\u8c61\u304b\u3089\u306f\u305a\u3059","author":"yamamoto","date":"2018\u5e741\u670829\u65e5","format":false,"excerpt":"SSL\u8a3c\u660e\u66f8\u3092\u7121\u6599\u3067\u53d6\u5f97\u3067\u304d\u308bLet's Encrypt\u3067\u3001 \u30b5\u30fc\u30d0\u30fc\u79fb\u884c\u3084\u30b5\u30a4\u30c8\u9589\u9396\u306a\u3069\u306b\u3088\u3063\u3066\u8a3c\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":996,"url":"https:\/\/clouds.tokyo\/blog\/kas_ssl_scan\/","url_meta":{"origin":1925,"position":1},"title":"\u3010\u30ab\u30b9\u30da\u30eb\u30b9\u30ad\u30fc\u3011\u30b5\u30a4\u30c8\u306eSSL\u8a3c\u660e\u66f8\u304c\u52dd\u624b\u306b\u5909\u66f4\u3055\u308c\u308b\u306e\u3092\u505c\u6b62\u3059\u308b","author":"yamamoto","date":"2018\u5e743\u670823\u65e5","format":false,"excerpt":"\u30ab\u30b9\u30da\u30eb\u30b9\u30ad\u30fc\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068 \u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30a6\u30a7\u30d6\u306eSSL\u901a\u4fe1\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":759,"url":"https:\/\/clouds.tokyo\/blog\/linux_lets_cent5\/","url_meta":{"origin":1925,"position":2},"title":"\u3010Linux\u3011CentOS5\u3067Let&#8217;s Encrypt\u3092\u4f7f\u3063\u3066\u30de\u30eb\u30c1\u30c9\u30e1\u30a4\u30f3\u306eSSL\u8a3c\u660e\u66f8\u3092\u767a\u884c\u3059\u308b","author":"yamamoto","date":"2017\u5e746\u670821\u65e5","format":false,"excerpt":"CentOS5\u3067\u30b7\u30b9\u30c6\u30e0\u3092\u904b\u7528\u3057\u3066\u3044\u307e\u3059\u30022010\u5e74\u306b\u30ea\u30ea\u30fc\u30b9\u3057\u305f\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002 \u65b0\u3057\u3044OS\u306b\u4e57\u308a\u63db\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":506,"url":"https:\/\/clouds.tokyo\/blog\/php_fgc_stat\/","url_meta":{"origin":1925,"position":3},"title":"\u3010PHP\u3011file_get_contents\u306e\u30a8\u30e9\u30fc\u51e6\u7406","author":"yamamoto","date":"2007\u5e7411\u670813\u65e5","format":false,"excerpt":"file_get_contents\u306f\u30d5\u30a1\u30a4\u30eb\u53d6\u5f97\u3060\u3051\u3067\u306a\u304f\u3001\u4ed6\u306e\u30b5\u30a4\u30c8\u306eAPI\u3092\u30b3\u30fc\u30eb\u3057\u305f\u308a\u3059\u308b\u3068\u304d\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1618,"url":"https:\/\/clouds.tokyo\/blog\/certbot-error\/","url_meta":{"origin":1925,"position":4},"title":"\u3010Let&#8217;s Encrypt\u3011certbot renew \u3067 Type:  unauthorized \u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3057\u305f","author":"yamamoto","date":"2023\u5e7411\u670827\u65e5","format":false,"excerpt":"certbot renew\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u30c9\u30e1\u30a4\u30f3\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u3044\u308d\u3044\u308d\u3068\u8a66\u3059\u305f\u3073\u306b\u30a8\u30e9\u30fc\u306e\u7a2e\u985e\u304c\u5909\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":366,"url":"https:\/\/clouds.tokyo\/blog\/linux_ssl_le\/","url_meta":{"origin":1925,"position":5},"title":"\u3010Linux\u3011\u3068\u3046\u3068\u3046SSL\u8a3c\u660e\u66f8\u306f\u7121\u6599\u3067\u53d6\u5f97\u3067\u304d\u308b\u6642\u4ee3\u306b","author":"yamamoto","date":"2016\u5e747\u67086\u65e5","format":false,"excerpt":"\u6614\u306fSSL\u8a3c\u660e\u66f8\u306f\u500b\u4eba\u304c\u6c17\u8efd\u306b\u5c0e\u5165\u3067\u304d\u308b\u3088\u3046\u306a\u5b89\u3044\u3082\u306e\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002 \u4eca\u306f\u5343\u5186\u304f\u3089\u3044\u3067\u53d6\u5f97\u3067\u304d\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/1925"}],"collection":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/comments?post=1925"}],"version-history":[{"count":3,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/1925\/revisions"}],"predecessor-version":[{"id":1928,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/1925\/revisions\/1928"}],"wp:attachment":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/media?parent=1925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/categories?post=1925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/tags?post=1925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}