[resolved] Secure connection to heroku (aws, ssl)

Four Stars

[resolved] Secure connection to heroku (aws, ssl)

I am struggling to establish a connection to postgresql server that requires ssl authenticaiton. In postgresql driver 9.2.1004 there exist an option without validating the server's certificate (NonValidatingFactory) however the current talend driver 9.2.1003 does not support it. How can I connect to the database via ssl?
I am using esb 5.5.0.

Accepted Solutions
Four Stars

Re: [resolved] Secure connection to heroku (aws, ssl)

I was quite struggling with this issue. If I remember correctly I have searched the appropriate driver that contained a class nonValidatingFactory and included it into the job. After that I think I had to do some modifications in the url too. Check the pics bellow. Hope it helps.

All Replies
Four Stars

Re: [resolved] Secure connection to heroku (aws, ssl)

and the pictures..
Four Stars

Re: [resolved] Secure connection to heroku (aws, ssl)

Hi Mertez,
Following is connection string
Driver={PostgreSQL ANSI};Server=IP address;Port=5432;Database=myDataBase;
Uid=myUsername;Pwd=myPassword;sslmode=require;
https://www.connectionstrings.com/postgresql/
which says sslmode - require which is case sensitive...
Can you connect using existing string from a client?
vaibhav
Four Stars

Re: [resolved] Secure connection to heroku (aws, ssl)

For establishing a secure connection via ssl you need a public certificate of the target server that you should put in your trusted computer java keystore (correct me if am wrong). If you do not have the certificate in the javastore you can bypass the server validation with the option "NonValidatingFactory" but still make an ecrypted connection. For now we are in a development stage so we try to use the above mentioned option which is not available in the v9.x driver and because of that the error from the attached picture appears.
The problem is that driver does not contain any NonValidatingFactory class.
One Star

Re: [resolved] Secure connection to heroku (aws, ssl)

hello mertez,
did you solve your problem somehow?
One Star

Re: [resolved] Secure connection to heroku (aws, ssl)

I'm having the same problem in connecting Talend Open Studio for Data Integration (5.6.1) to my PostgreSQL Database on Heroku:

 
Connection failure. You must change the Database Settings.
  java.lang.RuntimeException: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "XXX.X.XXX.XX", user "xxxxxxxxxx", database "xxxxxxxxxx", SSL off
      at org.talend.core.model.metadata.builder.database.JDBCDriverLoader.getConnection(JDBCDriverLoader.java:164)
      at org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils.connect(ExtractMetaDataUtils.java:1054)
      at org.talend.core.model.metadata.builder.database.ExtractMetaDataFromDataBase.testConnection(ExtractMetaDataFromDataBase.java:311)
      at org.talend.repository.ui.utils.ManagerConnection.check(ManagerConnection.java:272)
      at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm$26.runWithCancel(DatabaseForm.java:2335)
      at org.talend.repository.ui.wizards.metadata.connection.database.DatabaseForm$26.runWithCancel(DatabaseForm.java:1)
      at org.talend.repository.ui.dialog.AProgressMonitorDialogWithCancel$1.runnableWithCancel(AProgressMonitorDialogWithCancel.java:77)
      at org.talend.repository.ui.dialog.AProgressMonitorDialogWithCancel$ARunnableWithProgressCancel$1.call(AProgressMonitorDialogWithCancel.java:161)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "XXX.X.XXX.XX", user "xxxxxxxxxx", database "xxxxxxxxxx", SSL off
      at org.postgresql.Driver$ConnectThread.getResult(Driver.java:348)
      at org.postgresql.Driver.connect(Driver.java:271)
      at org.talend.core.model.metadata.builder.database.DriverShim.connect(DriverShim.java:41)
      at org.talend.core.model.metadata.builder.database.JDBCDriverLoader.getConnection(JDBCDriverLoader.java:155)
      ... 9 more

Any help would be most appreciated.
Thanks,
Chandra
Four Stars

Re: [resolved] Secure connection to heroku (aws, ssl)

I was quite struggling with this issue. If I remember correctly I have searched the appropriate driver that contained a class nonValidatingFactory and included it into the job. After that I think I had to do some modifications in the url too. Check the pics bellow. Hope it helps.
Four Stars

Re: [resolved] Secure connection to heroku (aws, ssl)

String from the database field is probably redundant so I think you can remove it.
One Star

Re: [resolved] Secure connection to heroku (aws, ssl)

Worked like a charm. Thanks a lot for the quick and prompt reply. You are a life savior.Smiley Happy
Four Stars

Re: [resolved] Secure connection to heroku (aws, ssl)

Hehe, I am happy to hear that we solved the issue Smiley Happy
One Star

Re: [resolved] Secure connection to heroku (aws, ssl)

this is exactly what I needed, Thanks!