Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: Support for SSL, Keep alive as connection option #9

Open
guruatmicrosoft opened this issue Feb 11, 2017 · 6 comments
Open

Re: Support for SSL, Keep alive as connection option #9

guruatmicrosoft opened this issue Feb 11, 2017 · 6 comments

Comments

@guruatmicrosoft
Copy link

guruatmicrosoft commented Feb 11, 2017

Couldnt see a place to put this request, it may not be an issue but rather feature ask.

I need to pass following options to my connection -
?tcpKeepAlive=true&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

Most of the code and document reference option as {rawConnection: true}, is there a way i can include above?

Thanks

@dmanjunath
Copy link
Owner

dmanjunath commented Feb 12, 2017

@guruattimeinc Yeah that's something that not currently supported, there's no way to pass in those parameters. The underlying node module(https://github.com/brianc/node-postgres) I'm using handles the actual connection to the database and it looks for specific options which are specified here(https://github.com/brianc/node-pg-pool#create)

Just out of curiosity where are you trying to connect? Because that doesn't look like any redshift connection in javascript i've ever seen.

@guruatmicrosoft
Copy link
Author

This is redshift DB, we have turned SSL settings. Is there a way i can setup connection with JDBC connection string?
At the moment i am passing these params as part of connection string in SQL workbench.

Thanks

@dmanjunath
Copy link
Owner

@guruattimeinc Oh I see, you're using JDBC with SQL workbench. There are {ssl: true, and keepAlive: true} properties you can pass into the configuration, but there's no way to to pass the sslfactory parameter. If you try connecting with just those two properties does it work?

@SgtPooki
Copy link

I am getting the same error and adding {ssl: true, and keepAlive: true} does not fix the problem for me.

@SgtPooki
Copy link

I got things working with this:

const Redshift = require('node-redshift');
const fs = require('fs');

const client = {
  user: 'me',
  database: 'minez',
  password: 'secret',
  port: '1234',
  host: 'nunya',
  ssl: true,
};
const options = {
  ssl: {
    isServer: false,
    rejectUnauthorized: true,
    requestCertifiate: true,
    cert: fs.readFileSync("./cert.crt").toString(),
  },
  rawConnection: true,
};

const redshiftClient = new Redshift(client, options);

@293nav
Copy link

293nav commented Dec 31, 2020

This is redshift DB, we have turned SSL settings. Is there a way i can setup connection with JDBC connection string?
At the moment i am passing these params as part of connection string in SQL workbench.

Thanks

I am also connecting to redshift using a JDBC connection string on SQL Workbench/J , even we pass the ?ssl=true&sslfactory values in the JDBC connection string.

I was able to connect to this redshift and query it while using the following code

const Redshift = require('node-redshift')

/** Set ssl : true **/

const client = {
	user : USER_NAME,
        database : DB_NAME,
        password : PASSWORD,
        port : '5439',
        host: HOST_URI,
        ssl : true
}

const redshiftClient = new Redshift(client, {rawConnection : true})

The above code worked for me with ssl : true, without specifying this I was getting this error "no pg_hba.conf entry for host"

Hope this helps anyone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants