Home > C/C++, PHP > xmlrpc over https implementation

xmlrpc over https implementation

On a project we were using SSH2 module of PHP, but it was turning out to be a total mess due to compatibility issues on different operating and for the reason that it cant be built on all the operating systems easily. This made us to think about other alternatives but there are not many option in PHP where you can get much more control when using SSH.

The solution was to write our own Agent that could perform all kinds of functions we were using from the SSH library of PHP. The two functions we were using the most were:

– SSH function to run a program or service on a remote machine
– SSH function to copy a file to a remote

When writing our own agent we made a choice to go with xmlrpc as it is a pretty simple library and it will not be months of work using xmlrpc to implement our own server.

Now when looking for xmlrpc libararies for C/C++ you do not have a lot of choices available when you want to go for a HTTPS standalone server (because we can not install web server on an Agent machine). So in the end we went with “libiqxmlrpc” which is a C++ based library and very easy to use.

While implementing the server functionality the only problem that I didnt like was when ever you run a new process through libiqxmlrpc based server the process basically attaches it self to the sane port the server was running so even if the server quits, the server port is still blocked. For that we had to modify the library code in way to get the file descriptor for server socket and then close that socket using the file descriptor ID in the Server code when forking a child to run the process.

Other then this libiqxmlrpc library has been flawless for me and it integrated very nicely with PHP side as well using cURL that supports HTTPS server through its OpenSSL support.

Anyone doing xmlrpc over HTTPS, I will highly recommend libiqxmlrpc.

-Shoaib Mir

Categories: C/C++, PHP Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: