Open jlporter opened 12 years ago
I just got this same error. +1
+1 just got the same thing.
I found the problem. It ignores {secure:true}. In this._url (cradle.js L254), it sets the uri to https if the protocol was set, and it sets options.secure based on protocol in the initialization, but never the other way around.
If you explicitly set "https://" it should work.
CONFIRMED.
Same here.
I was having this issue, until I realised that I wasn't working with the 0.6.x versions of Cradle.
If you're following the tutorial here: http://blog.nodejitsu.com/a-simple-webservice-in-nodejs (or http://ddewaele.blogspot.com.au/2012/04/nodejs-on-apple-os-x-lion.html)
... and you cloned the example code from https://github.com/indexzero/nodejs-intro.git
... then, using Cloudant, you'll get the above-reported issues.
The problem is that the example code's package.json sets Cradle to 0.5.x - obviously the Cloudant-friendly updates are contained somewhere in the 0.6.x stream.
How to test:
var cradle = require('cradle'); var conn = new (cradle.Connection)('appXXXXX.heroku.cloudant.com', 80, {auth:{username:"appXXXXXXX.heroku", password:"XXXXXXXXXXXX"}}); conn.databases(function(a,b){ console.log(a,b); });
output should be a list of the databases you have on your Cloudant host eg. for me it was: null [ 'basic', 'test' ]
Also having this error when attempting to connect to a Cloudant database over SSL from inside a Heroku app (Node 0.8.14, Cradle 0.6.4).
[Error: 139860364240672:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:683:]
As far as I can see @deitch is correct. Setting secure=true
in your options isn't enough, you need to add https://
to the start of your hostname too.
Another thing that can cause this is asking to use port 80 on the end of a hostname with the protocol https :)
I recently tried to update to cradle 0.6.1 from 0.5.8 and am getting SSL errors when attempting to connect to my Cloudant hosted DB. Here is the test program I am using.
When I run this, the callback from info (or any of the other cradle API function) has the following error message
[Error: 140735330154848:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:683: ]
I am testing with node v0.6.10.