繁体   English   中英

卷曲POST和GET响应

[英]curl POST and GET response

我正在尝试编写一个简单的单行代码,该文件将带有.crt并将其作为SSLShopper.com传递给CRT检查器。 我可以发布数据,但是我得到的只是标题和HTTP响应。 他们网站上的表单看起来很简单,只需一个AJAX调用即可返回结果。 这是我到目前为止的内容:

curl -L -i -X POST -k "https://www.sslshopper.com/assets/snippets/sslshopper/ajax/ajax_decode.php" --data-binary @test.crt

是否可以同时进行POST和GET?

似乎您需要使用以下参数以表单网址编码格式发送数据:

  • cert_text={CERT_CONTENT}
  • decode_type=certificate

您还需要X-Requested-With: XMLHttpRequestConnection: keep-alive标头:

cert_content=$(cat test.crt)
curl 'https://www.sslshopper.com/assets/snippets/sslshopper/ajax/ajax_decode.php' \
    -H 'X-Requested-With: XMLHttpRequest' \
    -H 'Connection: keep-alive' \
    --data-urlencode "cert_text=$cert_content" \
    --data-urlencode "decode_type=certificate"

但是对于此任务,您无需调用某些端点即可检查证书,如https://www.sslshopper.com/certificate-decoder.html中所指定,您可以直接使用

openssl x509 -in test.crt -noout -subject -enddate -startdate -issuer -serial

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM