couchdb-push icon indicating copy to clipboard operation
couchdb-push copied to clipboard

{message: 'error happened in your connection', scope: 'socket', errid: 'request'} after changing to https

Open OliverAndersRWE opened this issue 3 years ago • 5 comments

Hello, I would like to use the https connection (on port:443), but I receive the {message: 'error happened in your connection', scope: 'socket', errid: 'request'} Error. Is there somethin I have to consider for https and different ports? Kind regards Oliver

OliverAndersRWE avatar Aug 30 '22 13:08 OliverAndersRWE

No, it should work with https out of the box. Could you provide more information about how you called it?

jo avatar Aug 30 '22 13:08 jo

I call push(serverUrl,targetAppPath, function(err, resp) { if (err) { console.log(chalk.red.underline("ERROR")) console.log(chalk.red(JSON.stringify(err))) } else { console.log(chalk.green.bold.underline("SUCCESS")) console.log(resp) } }) where serverurl is like https://userId:[email protected]:443/dbName

the error occurs in couchdb-ensure/index.js line 8 in the request function:

module.exports = function configure (url, callback) { const db = nanoOption(url) const couch = nanoOption({ url: db.config.url, parseUrl: false })

couch.request({ method: 'HEAD', db: db.config.db }, function (error) { if (!error) return callback(null, existResponse) if (error.statusCode !== 404) return callback(error)

Hope this helps?

Kind Regards, Oliver

OliverAndersRWE avatar Aug 30 '22 13:08 OliverAndersRWE

Thats strange, I took your example and it worked for me.

Do you use the most recent version of couchdb-push (3.1.0)?

jo avatar Aug 30 '22 13:08 jo

Hi, devDependencies": { ... "couchdb-push": "^3.1.0", ... }

I'm using the version above... I switched back to the http connection and the port 5982 and it worked again.

I will try to set up a seperate project for testing and will ping back when this solves the issue...

Many thanks for looking into it.

Kind Regards, Oliver

OliverAndersRWE avatar Aug 30 '22 13:08 OliverAndersRWE

Yeah let me know the outcome, I'm happy to help.

jo avatar Aug 30 '22 16:08 jo