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->xmlrpc->set_debug(TRUE);
---DATA---
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 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>Found</h1> <p>The document has moved <a href="https://mydomain.com/app">here</a>.</p> <hr> <address>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15 Server at mydomain.com Port 80</address> </body></html> ---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); ---DATA--- 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <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;} /*]]>*/--></style> </head> <body> <h1>Bad request!</h1> <p> Your browser (or proxy) sent a request that this server could not understand. </p> <p> If you think this is a server error, please contact the <a href="mailto:[email protected]">webmaster</a>. </p> <h2>Error 400</h2> <address> <a href="/">www.example.com</a><br /> <span>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15</span> </address> </body> </html> ---END DATA---
Does anybody have a working example for xml-rpc client-server communication over https?
It's fairly easy to extend CI's XMLRPC so you can use it with SSL. I was working on this years ago:
https://github.com/skunkbad/MY_Xmlrpc 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. |
Welcome Guest, Not a member yet? Register Sign In |