开发者

Read ssl data from PHP socket_listen()

Lets say a listening socket is created in PHP, and it accepts a secure connection. How do I know that it's encrypt开发者_开发知识库ed and how do I decode it?


From the way your question is worded, you are a very long way from being to implement any sort of solution to the question as you've asked it. Implementing your own SSL server using PHP and off the shelf components will be virtually impossible even for a total PHP guru. I don't imagine that anyone who really understood the problem would try to solve it in this way - a far more pragmatic approach would be to set up the server to listen on two different ports (or use 2 seperate servers) use an SSL proxy (e.g. stunnel) which only accepts connections from localhost for the SSL traffic, and write your server(s) to talk non-SSL. You know its secure if the connection arrives from localhost and on the port that listens for the stunnel connection (or someone is running their own client/proxy on your server).

HTH

C.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜