Welcome Guest, Not a member yet? Register   Sign In
Need help with Xmlrpc over https

Hello everybody, I need some help with Xmlrpc over https.

When I try to send a request to the server, I get this error

"Did not receive a '200 OK' response from remote server. (HTTP/1.1 302 Found)"

I think that this happens because of my htaccess, which is

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mydomain.com/$1 [R,L]

I use this htaccess configuration because I want to force every request over https instead of http. Can this be the root cause of my problem? There's a way to avoid https rewrite if the request is already sent over https?

Turn on debugging, client side, to see what the server is actually returning.


(This post was last modified: 07-12-2015, 07:40 PM by geekita.)


HTTP/1.1 302 Found
Date: Mon, 13 Jul 2015 02:34:10 GMT
Server: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15
Location: https://mydomain.com/app
Content-Length: 327
Connection: close
Content-Type: text/html; charset=iso-8859-1

<title>302 Found</title>
<p>The document has moved <a href="https://mydomain.com/app">here</a>.</p>
<address>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15 Server at mydomain.com Port 80</address>

---END DATA---

$this->xmlrpc->server('https://mydomain.com/' . 'app', 80);

Anyway it works nicely if I remove the htaccess config.

This is the response if I try to use 443 port

$this->xmlrpc->server('https://mydomain.com/' . 'app', 443);

HTTP/1.1 400 Bad Request
Date: Mon, 13 Jul 2015 02:36:46 GMT
Server: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15
Vary: accept-language,accept-charset
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=utf-8
Content-Language: en
Expires: Mon, 13 Jul 2015 02:36:46 GMT

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<title>Bad request!</title>
<link rev="made" href="mailto:[email protected]" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
body { color: #000000; background-color: #FFFFFF; }
a:link { color: #0000CC; }
p, address {margin-left: 3em;}
span {font-size: smaller;}

<h1>Bad request!</h1>

Your browser (or proxy) sent a request that
this server could not understand.

If you think this is a server error, please contact
the <a href="mailto:[email protected]">webmaster</a>.


<h2>Error 400</h2>
<a href="/">www.example.com</a><br />
<span>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15</span>

---END DATA---

It sounds like your xmlrpc request is not being wrapped properly.

Does anybody have a working example for xml-rpc client-server communication over https?

Up :/

It's fairly easy to extend CI's XMLRPC so you can use it with SSL. I was working on this years ago:


While it is for CI 2.X, you should be able to do something similar for your app.

Thanks skunkbad! So you're telling me that XML-RPC library shipped with CI doesn't support SSL natively?

(11-28-2015, 03:13 PM)geekita Wrote: Thanks skunkbad! So you're telling me that XML-RPC library shipped with CI doesn't support SSL natively?

It didn't back then, and since I haven't used it in years I can't tell you for sure, but I don't believe the SSL support is there now.

One thing you might consider is just making your own library. I really didn't like using CI's, and that's why I didn't continue using it.

Theme © iAndrew 2016 - Forum software by © MyBB