|
Hi, I'm trying to log in into Webfaction using the XMLRPC API and Ruby library. Problem is:
While trying this simple example found in the docs, the login call to the server results in:
As you can see. I'm using Windows Ruby 1.9.3p0 . Any ideas? |
|
With Ruby, to bypass the Certificate error you have to somewhat hack into the API of the xmlrpc/client library. And that is because the API does not provide any simple solution to turn off that warning about the certificate, but here is what I found and it works.
The important line being:
That turns off the warning and let you connect to the API via xmlrpc library. Thanx for the help. Even if I could have used Python, I already had the Ruby code, so this hack is faster and better tan porting the script. Edit: This works on Ruby 1.9.3p0 and pretty sure it works on most 1.9.x versions. |
Can it be something to do with the API being down? If I go to https://api.webfaction.com/ I got a 404 Not Found error. If I try to login through the Python xmlrpclib I got a Protocol error from /RPC2 same 404 Not found error.
The 404 error is normal, as a browser can not communicate with the API. I can not reproduce the certificate error on my machine. Google Searching for the error seems to suggest this is a problem with Ruby 1.9 and its ability to find the certs. I was unable to locate a solution for windows, nor have access to a windows machine to test.
Do you know something of Python having 404 error too?
No, I was doing my testing with python and it was working. Is it possible to try another OS/machine? Can you post the python code you tested too?
I tried using the code from the webpage:
And its working now, maybe the API was offline last time I tried. Anyway, for the Ruby example I'm posting the answer. Thanx for your help.