{"id":517867,"date":"2021-07-18T15:24:17","date_gmt":"2021-07-18T07:24:17","guid":{"rendered":"http:\/\/4563.org\/?p=517867"},"modified":"2021-07-18T15:24:17","modified_gmt":"2021-07-18T07:24:17","slug":"%e7%ac%a8%e7%89%9b%e5%85%b3%e9%97%ad%ef%bc%8c%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aa%e6%9b%b4%e6%94%b9cf%e9%9d%a2%e6%9d%bfssl%e6%a0%a1%e9%aa%8c%e6%96%b9%e5%bc%8f%e7%9a%84%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=517867","title":{"rendered":"\u7b28\u725b\u5173\u95ed\uff0c\u5206\u4eab\u4e00\u4e2a\u66f4\u6539cf\u9762\u677fssl\u6821\u9a8c\u65b9\u5f0f\u7684\u811a\u672c"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>CMBC<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u7b28\u725b\u5173\u95ed\uff0c\u5206\u4eab\u4e00\u4e2a\u66f4\u6539cf\u9762\u677fssl\u6821\u9a8c\u65b9\u5f0f\u7684\u811a\u672c<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 CMBC \u4e8e 2021-7-18 15:22 \u7f16\u8f91 <\/p>\n<p> \u7406\u5e94\u9002\u5408\u6240\u6709linux\u670d\u52a1\u5668<br \/>  \u5fc5\u8981\u73af\u5883\uff1a\u5b89\u88c5 jq&nbsp; &nbsp;redhat\u7cfb\u5217\uff0cyum install -y jq \u5176\u4ed6\u5e94\u8be5\u7c7b\u4f3c\u3002 <br \/>  \u5c06\u4e0b\u9762\u5185\u5bb9\u7c98\u8d34\u5230\u670d\u52a1\u5668\u6587\u6863\u4e2d\uff0c\u4f8b\u5982\u4fdd\u5b58\u4e3acf.sh \u5219\u8fd0\u884c bash cf.sh abc.com&nbsp; &nbsp;<br \/>  \u6b64\u5904\u7684abc.com\u4e3acf\u9762\u677f\u6dfb\u52a0\u7684\u57df\u540d\u5c06\u539f\u6709\u7684http\u6539\u4e3atxt \u3002\u5176\u4ed6\u7684\u53ef\u4ee5\u81ea\u5df1\u5728\u6700\u540e\u4fee\u6539 \u652f\u6301cname email\u7b49<br \/>  \u4ee3\u7801\u5982\u4e0b\uff0c\u91cc\u9762\u8bb0\u5f97\u6dfb\u52a0\u81ea\u5df1\u7684email\u548ckey<\/p>\n<p>  loc\u4ee3\u7801\u7f29\u8fdb\u6709\u95ee\u9898\uff0c\u76f4\u63a5\u5c06\u9644\u4ef6\u4e0b\u8f7d\u4fee\u6539\u540e\u7f00\u4e3ash\u6216\u8005\u76f4\u63a5\u8fd0\u884c\u90fd\u53ef<\/p>\n<p>  #!\/usr\/bin\/bash<br \/>  domain=$1<br \/>  cfemail=test@abc.com<br \/>  cfapikey=259faeef511a847efxxxxxxxxxxxxxxxxxxx<br \/>  result=`curl -s -X GET &quot;https:\/\/api.cloudflare.com\/client\/v4\/zones?name=$domain&quot; <br \/>  &nbsp; &nbsp;-H &quot;X-Auth-Email: $cfemail&quot; <br \/>  &nbsp; &nbsp;-H &quot;X-Auth-Key: $cfapikey&quot; <br \/>  &nbsp; &nbsp;-H &quot;Content-Type: application\/json&quot;`<br \/>  zone_identifier=`echo $result | jq .result.id`<br \/>  zone_identifier=`echo $zone_identifier | sed &#8216;s\/&quot;\/\/g&#8217;`<\/p>\n<p>  result=`curl -s -X GET &quot;https:\/\/api.cloudflare.com\/client\/v4\/zones\/$zone_identifier\/ssl\/certificate_packs?status=all&quot; <br \/>  &nbsp; &nbsp;-H &quot;X-Auth-Email: $cfemail&quot; <br \/>  &nbsp; &nbsp;-H &quot;X-Auth-Key: $cfapikey&quot; <br \/>  &nbsp; &nbsp;-H &quot;Content-Type: application\/json&quot;`<br \/>  result=`echo $result | jq .result`<br \/>  result_length=`echo $result | jq length`<br \/>  i=0<br \/>  while [ $i -lt $result_length ]<br \/>  do<br \/>   packge_id=`echo $result | jq .[$i].id`<br \/>   packge_id=`echo $packge_id | sed &#8216;s\/&quot;\/\/g&#8217;`<br \/>   res=`curl -s -X PATCH &quot;https:\/\/api.cloudflare.com\/client\/v4\/zones\/$zone_identifier\/ssl\/verification\/$packge_id&quot; <br \/>  &nbsp; &nbsp; -H &quot;X-Auth-Email: $cfemail&quot; <br \/>  &nbsp; &nbsp; -H &quot;X-Auth-Key: $cfapikey&quot; <br \/>  &nbsp; &nbsp; -H &quot;Content-Type: application\/json&quot; <br \/>  &nbsp; &nbsp; &#8211;data &#8216;{&quot;validation_method&quot;:&quot;txt&quot;}&#8217; `<br \/>   echo name:`echo $res|jq .result.verification_info.txt_name`&#8217;&nbsp; &nbsp;type:&#8217;`echo $res|jq .result.validation_method`&#8217;value:&#8217;`echo $res|jq .result.verification_info.txt_value`<br \/>   i=$(($i+1))<br \/>  done<\/p>\n<p>  \t\t\t\t\t<strong>\u6211\u662f\u574f\u866b<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6ca1\u6709\u5173\u95ed\u554a,\u8fd8\u53ef\u4ee5\u767b\u9646\u6b63\u5e38\u4f7f\u7528https:\/\/cdn.jsdelivr.net\/gh\/hishis\/forum-master\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>CMBC<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6211\u662f\u574f\u866b \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2021-7-18 15:21<br \/>  \u6ca1\u6709\u5173\u95ed\u554a,\u8fd8\u53ef\u4ee5\u767b\u9646\u6b63\u5e38\u4f7f\u7528<\/p>\n<p> \u5e0c\u671b\u4f60\u7684cookie\u6c38\u4e0d\u5931\u6548\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>CMBC \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u7b28\u725b\u5173\u95ed&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/517867"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=517867"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/517867\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=517867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=517867"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=517867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}