duandu1377 2019-04-28 17:02
浏览 56

php网站的安全体系结构向localhost上的WCF服务发送REST请求

I want to secure and/or verify a request coming from a PHP web server to a WCF service running on a localhost which executes commands on that PC. There could potentially be many WCF services running on several different PC's on their own localhost, but there will only ever be one PHP web server.

In this instance, the PHP web server is acting as the client, and is consuming the WCF service which is acting as the server.

At the moment, the PHP sends a POST request using curl to an IP address and port number (1.2.3.4:5 for example) and gets a reply. However, anyone could send the same message to that IP address and also get a reply. I need some way of verifying the POST request came from the PHP web server and not by anyone else. The actual message doesn't contain any sensitive information, so encryption isn't needed, although I do plan to add this in at some point.

I thought it would be possible to do this using SSL, as the web server has a certificate, and POST the data over https (https://1.2.3.4:5). From I've read on the interwebs though this only works if the localhost also has a trusted certificate. So I looked into generating one manually using MKCERT, but this won't work I believe as the certificate on the web server won't trust it.

I also thought about restricting incoming requests to the IP address of the web server, but I believe this can be spoofed.

The only other option I can think of is that once the WCF service receives a request, it checks with the PHP web server to see if that request came from there, but if there was another way which avoided a round trip back to the PHP web server that would be preferable for performance reasons.

As I mentioned, the actual message doesn't contain sensitive data, I just need to make sure that the message came from a particular web server.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 latex怎么处理论文引理引用参考文献
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
    • ¥15 乘性高斯噪声在深度学习网络中的应用