Forum OpenACS Development: XML-RPC on HTTPS

Request notifications

Collapse
Posted by Iuri Sampaio on
Hi there,

How come XML-RPC does not support HTTPS?
In attempt to request https://www.evex.co/RPC2 it returns failure due to invalid URL.

Is there a handy parameter already in order to et HTTPS up? If negative, is there a way to create a parameter for this feature on xmlrpc package ?

Error: xmlrpc::remote_call url: https://www.evex.co/RPC2 request: <?xml version="1.0"?> wsevex.loginUser mailto:iuri@iurix.coma6e45537d92f85583f1370725d9343b8 error: Invalid url "https://www.evex.co/RPC2":
[01/Apr/2017:18:24:49][7717.b476ab70][-conn:evex:0-] Notice: HTTP_ERROR {HTTP request failed due to "Invalid url "https://www.evex.co/RPC2": "}

Collapse
2: Re: XML-RPC on HTTPS (response to 1)
Posted by Gustaf Neumann on
A quick look in the package xml-rpc tells me, that the package is using "ns_httpopen", which does not support https, since it uses raw write operations on sockets. It should be altered to use the more modern util::http::* interface.

The package does not belong to the ~90 packages i am trying to maintain, but there are many more other users who have write permissions to CVS.

Collapse
3: Re: XML-RPC on HTTPS (response to 2)
Posted by Iuri Sampaio on
In fact there is! ns_httpopen is used within packages/xml-rpc/tcl/xml-rpc-procs.tcl I tried to fix but after switching ns_httpopen to whether [util::http:post] or [ns_http], both started to return errors. #packages/xml-rpc/tcl/xml-rpc-procs.tcl set req_hdrs [ns_set create] # headers necessary for a post and the form variables ns_set put $req_hdrs Accept "*/*" ns_set put $req_hdrs User-Agent "[ns_info name]-Tcl/[ns_info version]" ns_set put $req_hdrs "Content-type" "text/xml" ns_set put $req_hdrs "Content-length" [string length $content] Neither -- set http [ns_httpopen POST $url $req_hdrs 30 $content] ++ set http [util::http::post -url $url -headers $req_hdrs -timeout 30 -body $content] Nor -- set http [ns_httpopen POST $url $req_hdrs 30 $content] body $content] ++ set http [ns_http run -method POST -headers $req_hdrs -timeout 30 -body $content $url] The remote call for testing purporses was: catch {xmlrpc::remote_call http://www.evex.co/RPC2 blogger.newPost -string "dsdsddfrerevgrtere" -int 1197 -string "iuri@iurix.com" -string "jDEDW€@234fghaiIGJANEPQ" -string "text body" -boolean tru\ e} result Best wishes, Iuri Notice: request processor did not set ad_conn untrusted_user_id, fallback: 0 [02/Apr/2017:17:08:07][9989.b51f8b70][-conn:evex:4-] Error: xmlrpc::remote_call url: http://www.evex.co/RPC2 request: <?xml version="1.0"?> blogger.newPost dsdsddfrerevgrtere1197iuri@iurix.comjDEDW€@234fghaiIGJANEPQtext body1 error: can not find channel named "" [02/Apr/2017:17:08:07][9989.b51f8b70][-conn:evex:4-] Notice: HTTP_ERROR {HTTP request failed due to "can not find channel named """}
Collapse
4: Re: XML-RPC on HTTPS (response to 3)
Posted by Iuri Sampaio on
In fact there is!
ns_httpopen is used within packages/xml-rpc/tcl/xml-rpc-procs.tcl
I tried to fix but after switching ns_httpopen to whether [util::http:post] or [ns_http], both started to return errors.

#packages/xml-rpc/tcl/xml-rpc-procs.tcl
set req_hdrs [ns_set create]
# headers necessary for a post and the form variables
ns_set put $req_hdrs Accept "*/*"
ns_set put $req_hdrs User-Agent "[ns_info name]-Tcl/[ns_info version]"
ns_set put $req_hdrs "Content-type" "text/xml"
ns_set put $req_hdrs "Content-length" [string length $content]

Neither
-- set http [ns_httpopen POST $url $req_hdrs 30 $content]
++ set http [util::http::post -url $url -headers $req_hdrs -timeout 30 -body $content]

Nor
-- set http [ns_httpopen POST $url $req_hdrs 30 $content] body $content]
++ set http [ns_http run -method POST -headers $req_hdrs -timeout 30 -body $content $url]

The remote call for testing purposes was:
catch {xmlrpc::remote_call http://www.evex.co/RPC2 blogger.newPost -string "dsdsddfrerevgrtere" -int 1197 -string "mailto:iuri@iurix.com" -string "jDEDW€@234fghaiIGJANEPQ" -string "text body" -boolean tru\ e} result

See logs bellow

Best wishes,
Iuri



Notice: request processor did not set ad_conn untrusted_user_id, fallback: 0 [02/Apr/2017:17:08:07][9989.b51f8b70][-conn:evex:4-] Error: xmlrpc::remote_call url: http://www.evex.co/RPC2 request: <?xml version="1.0"?> blogger.newPost mailto:dsdsddfrerevgrtere1197iuri@iurix.comjDEDW€@234fghaiIGJANEPQtext body1 error: can not find channel named ""
[02/Apr/2017:17:08:07][9989.b51f8b70][-conn:evex:4-]
Notice: HTTP_ERROR {HTTP request failed due to "can not find channel named """}