Contents of /alx-src/branches/alx-web-070/include/socket_send.php
Parent Directory | Revision Log
Revision 9661 -
(show annotations)
(download)
Wed Aug 2 13:21:57 2017 UTC (6 years, 8 months ago) by niro
File size: 585 byte(s)
Wed Aug 2 13:21:57 2017 UTC (6 years, 8 months ago) by niro
File size: 585 byte(s)
-reworked socket send to be sha1 compatible with sslsvd, direct ssl with openssl not working anymore. need to rewrite sslsvd or deprecate it
1 | <? |
2 | include("config.inc.php"); |
3 | |
4 | function mcore_socket_send($ip, $port, $cmd) |
5 | { |
6 | global $mcore_certificate; |
7 | |
8 | // do not print output of system |
9 | ob_start(); |
10 | $fingerprint = system("openssl x509 -noout -modulus -in ".$mcore_certificate." | openssl sha1 | sed 's:(stdin)=\ ::'", $retval); |
11 | ob_clean(); |
12 | if ($retval == 0) |
13 | { |
14 | ob_start(); |
15 | system("/usr/bin/mcore-socket-send --ip='".$ip."' --port='".$port."' --fingerprint='".$fingerprint."' --command='".$cmd."'", $sockretval); |
16 | ob_clean(); |
17 | if ($sockretval == 0) echo "socket send succesfull"; |
18 | else "echo socket send failed"; |
19 | } |
20 | } |
21 | ?> |