在没有 HTTPS 的情况下保护服务器到服务器 PHP 通信的安全
我有一个 PHP 文件,我的客户将在他们的服务器上执行该文件。它不断与我的服务器通信。现在,如何在没有 SSL 的情况下防止此通信被窃听和中间人攻击? 我不需要 SSL 的原因是我在客户端 PHP 文件中使用 file_get_contents 来联系服务器(openSSL/CURL 可能在客户端上禁用,因此我被迫使用不带 SSL 的 file_get_contents)。
感谢您的时间和精力。
I have a PHP file which my clients will execute on their server. It constantly communicates with my server. Now, how can I prevent this communication from eaves-dropping and man in the middle attacks without SSL?
The reason I do not want SSL is that I am using file_get_contents in the client PHP file to contact server (openSSL/CURL may disabled on client so I am forced to use file_get_contents without SSL).
Thank you for your time and effort.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以对敏感数据进行加密和解密。
数据包将是可见的,但实际数据应该是安全的。
两台服务器都需要加密/解密密钥
you can encrypt the sensitive data and decrypt it.
the packets will be visible, but the actual data should be safe.
both servers will need the encryption/decryption keys
为了避免需要预共享私钥,您还可以考虑使用公钥选项,例如 GPG,它只需要希望与您联系的服务器拥有您的公钥,但只有您可以使用您的私钥解密数据。这减少了交易两端对预共享私钥的需求。
To prevent the need for pre-shared private keys, you could also look into a public key option such as GPG which would only necessitate the servers that wish to contact you having your public key, but only you could decrypt the data with your private key. This alleviates the need for a pre-shared private key on both ends of the transaction.
这个问题的唯一解决方案是使用定制的扰码器来完成这项工作。我不想走那么远,所以决定不传输任何重要信息并让这些通信手动完成。
Only solution for this problem will be to have a custom built scrambler do the job. I did not wanted to go that far so decided to not transmit any important information and let those communications be done manually.