Http 请求被托管提供商阻止?
我有一个简单的 Php 服务器,它期待简单的 http get 请求,然后用一些加密数据进行响应 http Web 请求是由一个小应用程序发出的,该应用程序使用 wininet.dll 发出 Web 请求。
当我使用浏览器发出相同的请求时,一切正常,并且预期数据从服务器回显,但是当我从应用程序发出请求时,它被托管提供商阻止。
这是我的 PHP 服务器:
<?php
$entityBody = htmlspecialchars($_GET["name"]);
$rest = substr($entityBody, 0, 2);
$str2 = substr($entityBody, 2);
$vval= file_get_contents("Private/$str2");
$cipher = 'AES-256-ECB';
$key = 'FFv3mgc21VgTcaFDOPzgl5hZsY74TcTh';
$plaintext = $vval;
if (strlen($plaintext) % 16) {
$plaintext = str_pad($plaintext, strlen($plaintext) + 16 - strlen($plaintext) % 16, "\0");
}
$chiperRaw = openssl_encrypt($plaintext, $cipher, $key, OPENSSL_NO_PADDING);
$ciphertext = trim(base64_encode($chiperRaw));
$ciphertext = $rest.$ciphertext;
echo($ciphertext);
?>
这是我使用应用程序发出请求时得到的响应:
什么可能导致此问题?
I have a simple Php server which is expecting the simple http get request and then Respond with some encrypted data
The http web request is made by a small application which uses wininet.dll to make the web request.
when I make the same request using a browser , everything works fine and intended data is echoed from the server , however when I make the request from the application , it gets blocked by the hosting provider.
this is my PHP server :
<?php
$entityBody = htmlspecialchars($_GET["name"]);
$rest = substr($entityBody, 0, 2);
$str2 = substr($entityBody, 2);
$vval= file_get_contents("Private/$str2");
$cipher = 'AES-256-ECB';
$key = 'FFv3mgc21VgTcaFDOPzgl5hZsY74TcTh';
$plaintext = $vval;
if (strlen($plaintext) % 16) {
$plaintext = str_pad($plaintext, strlen($plaintext) + 16 - strlen($plaintext) % 16, "\0");
}
$chiperRaw = openssl_encrypt($plaintext, $cipher, $key, OPENSSL_NO_PADDING);
$ciphertext = trim(base64_encode($chiperRaw));
$ciphertext = $rest.$ciphertext;
echo($ciphertext);
?>
and this is the response I get when I make the request using the Application:
what could cause this issue ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论