Welcome Guest, Not a member yet? Register   Sign In
XMLRPC over https
#1

Hello...
.
I having problem when use xmlrpc on client which will access XMLRPC server using https...
.
[Code Snippet]
[Image: 5FwJPYRrS5u-xLl-jBP-lg.png]

[Error]
[Image: JT2Sr1Q.jpg]

Please helpme to use xmlrpc over ssl on codeigniter..
.
Thanks
Reply
#2

You'll have to paste code inside a code block.

Have you turned debug on to see what is actually being returned?
In your server controller ...

Code:
        $this->load->library('xmlrpc');
        $this->load->library('xmlrpcs');
        $this->xmlrpc->set_debug(TRUE);

and then in your client...

Code:
            $this->xmlrpc->request($request);

            if (!$this->xmlrpc->send_request())
            {
                echo $this->xmlrpc->display_error();
                echo '<br/>' . var_dump($this->xmlrpc->response) . '<br/>';
            }

            $list = $this->xmlrpc->display_response();
Reply
#3

Thanks for the reply...
.
I have tried debugging and the results as below..
.
Code:
---DATA---
HTTP/1.1 301 Moved Permanently
Date: Fri, 26 Apr 2019 23:54:22 GMT
Connection: close
Cache-Control: max-age=3600
Expires: Sat, 27 Apr 2019 00:54:22 GMT
Location: https://www.mydomain.com/service/xmlrpc_test
Server: cloudflare
CF-RAY: 4cdc7b40b875d1f9-HKG


---END DATA---

Did not receive a '200 OK' response from remote server. (HTTP/1.1 301 Moved Permanently)array(0) { }

Array ( )

I have tried manual debugging and the problem solved by add some code at "system/libraries/Xmlrpc.php" on "sendPayload" function i add and manipulate $server variable use "ssl://" and use port 443 like this
Code:
/**
     * Send payload
     *
     * @param    object    $msg
     * @return    object
     */
    public function sendPayload($msg)
    {
        if ($this->proxy === FALSE)
        {
            $server = $this->server;
            $port = $this->port;
        }
        else
        {
            $server = $this->proxy;
            $port = $this->proxy_port;
        }

               // for ssl request i added this
               // and use port 443
               $server = "ssl://" . $server;
               
        $fp = @fsockopen($server, $port, $this->errno, $this->errstring, $this->timeout);
Reply




Theme © iAndrew 2016 - Forum software by © MyBB