14 Replies Latest reply on Sep 10, 2012 2:21 AM by Manuel Stiem

    XML-RPC Call require ssl

      Hi,

       

      my App is going to do some calls to a certain website. This website is only under https to reach.

      Rigth now I implemented some XML-RPC calls wich are working as long as I develop locally. So I do get a response and everything seems to work.

       

      But if I try it online I always get an error because of missing "openssl"

       

      1) So I tried to install the lib -> not available any more

       

      Does anyone has an idea how I can access to my ssl-secure website calls?

      I Just found this video which shows using AsyncHttp   (http://vimeo.com/12216299#) but how can I access real webservice calls ( I can switch to other than xmlrpc)

       

       

      here is what I did:

       

       

      def call

          #Make an object to represent the XML-RPC server.

          server = XMLRPC::Client.new2( "https://MY-URL","/xmlrpc.php" , 443)

          # Call the remote server and get our result

          result = server.call("my_xmlwebservide", just_a_number)
         
          name = result['name']
          return name
      end

       

      I hope someone has an idea

        • Re: XML-RPC Call require ssl /how to work with AsyncHttp as workaround ?

          XML-RPC is not currently supported.

           

          You can use AsyncHttp to make any https calls and then parse result:

           

          http://docs.rhomobile.com/rhodes/connect-to-web-services

           

           

           

          http://docs.rhomobile.com/rhodes/extensions#ruby-extensions

           

           

           

          see XML Handling

            • Re: XML-RPC Call require ssl /how to work with AsyncHttp as workaround ?

              Hi,

               

              xmlrpc is not the problem ... this works fine. I downloaded an XMLPRC library http://www.ntecs.de/ruby/xmlrpc4r/client.html#label-35 and  added into my /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework folder. I can use it. It works perfect. As long as I use it on port 8082 and not 443. This library supports ssl but rhomobile doesn't have it any more. So I downloaded the openssl extention from https://github.com/rhomobile/rhodes/tree/1.4.0 and pasted it into the extension folder to try to use it for my needs. But what ever I do, can't get it working. I always get the error can't find openssl.

               

              Do you have any Idea how I could get my setup working?

                • Re: XML-RPC Call require ssl /how to work with AsyncHttp as workaround ?

                  Openssl contains 2 parts: openssl.so – with all algorithms implementations and openssl ruby library, which is just wrapper over openssl.so for Ruby

                   

                  At this moment Rhodes does not support openssl.so, we are going to support it in next release

                    • Re: XML-RPC Call require ssl /how to work with AsyncHttp as workaround ?

                      Hey,

                       

                      good news! And thanks for answering both questions (here and in google group). I have seen you imported openssl again into the maaster branch. I will try out and tell how it works! :-)
                      Thanks a lot for helping in this particular case!!

                      • Re: XML-RPC Call require ssl /how to work with AsyncHttp as workaround ?

                        Hi, I still have a problem with open ssl. I use the former discribed XML-RPC library and downloaded the new OPENSSL extension. I added into the build.yml  "openssl.so" and  "openssl". My client still aks for the openssl.so which is declared in my XML-RPC Client Library.

                         

                        Error: no such file to load -- openssl<br/>Trace: <br/>
                        9/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `require'<br/>
                        10/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `<top (required)>'<br/>
                        11/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `require'<br/>
                        12/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `initialize'<br/>
                        13/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new'<br/>
                        14/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new2'<br/>
                        15/Users/manuelstiem/Documents/workspace/rhostudio/pharmasensor prototype/app/Xmlrpc/xmlrpc_controller.rb:67:in `call2'<br/>
                        16/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhocontroller.rb:91:in `serve'<br/>
                        17/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhoapplication.rb:226:in `serve'<br/>
                        18/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rho.rb:829:in `serve'

                         

                        what do I wrong?

                         

                        cheers Manu

                          • Re: XML-RPC Call require ssl /how to work with AsyncHttp as workaround ?
                            Jon Tara

                            You need to explicitly add openssl.so in your build.yml:

                             

                            extensions:

                            - openssl.so

                            - openssl

                            - digest

                            - digest-sha1

                            - digest-sha2

                            - digest-md5

                            - zlib

                            -net-http

                             

                            (You may not need all of these, but they are commonly used together.)

                             

                            I've had mixed results. I've been successful with XMPP4R doing TCP streaming with openssl. But net-http fails with https. The server gets requests and sends responses. My Rhodes app never sees the responses. Still looking into it, need to sick a protocol analyzer on it.

                            1 of 1 people found this helpful
                              • Re: XML-RPC Call require ssl /how to work with AsyncHttp as workaround ?

                                Hi Jon,

                                 

                                thanks for your advice. But unfortunally it does not help (yet)

                                How did you integrate your "XMPP4R" library into your app? I tried the following way:

                                 

                                1) added the xmlrpc library into the folder:

                                /Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/

                                 

                                -> xmlrpc works for Iphone but just http not https  ----is it possible to integrate this Ruby library like an extension ( insert extension folder into app root and copy the folder ito it, and add in the build.yml "xmlrpc"--

                                 

                                and now I tried to add openssl:

                                 

                                1) added extensions:

                                - openssl.so

                                - openssl

                                - digest

                                - digest-sha1

                                - digest-sha2

                                - digest-md5

                                - zlib

                                -net-http

                                 

                                but the now the nett-https is looking for openssl and can't find it:

                                Error: no such file to load -- openssl<br/>Trace: <br/>
                                9/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `require'<br/>
                                10/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/extensions/net-http/net/https.rb:94:in `<top (required)>'<br/>
                                11/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `require'<br/>
                                12/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:312:in `initialize'<br/>
                                13/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new'<br/>
                                14/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/xmlrpc/client.rb:357:in `new2'<br/>
                                15/Users/manuelstiem/Documents/workspace/rhostudio/pharmasensor prototype/app/Xmlrpc/xmlrpc_controller.rb:67:in `call2'<br/>
                                16/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhocontroller.rb:91:in `serve'<br/>
                                17/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rhoapplication.rb:226:in `serve'<br/>
                                18/Library/Ruby/Gems/1.8/gems/rhodes-3.3.2/lib/framework/rho/rho.rb:829:in `serve'   

                                 

                                any idea?