cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

SSL connection java.sql.SQLException with Redshift

cfregly
Contributor
 
4 REPLIES 4

cfregly
Contributor

If you see the following error without SSL:

java.sql.SQLException: [Amazon](500150) Error setting/closing connection: no pg_hba.conf entry for host "x.x.x.x", user "user", database "database", SSL off.

then the following error with SSL enabled:

java.sql.SQLException: [Amazon](500150) Error setting/closing connection: General SSLEngine problem.

You can try appending

sslfactory=org.postgresql.ssl.NonValidatingFactory
to the connection URL to fix the problem.

mbphill
New Contributor II

I am having the same issue. That did not work for me I am still getting the same error. Did you get your issue resolved?

TianziCai
New Contributor II

I also have the same issue. The suggested solution did not work. Also as a side note, everything had been working until last Friday...

TianziCai
New Contributor II

sample = (spark.read
          .format("com.databricks.spark.redshift")
          .option("url", jdbcUrl)
          .option("dbtable", "xx.xxx") # schema, table
          .option("forward_spark_s3_credentials", True)
          .option("tempdir", tempDir)
          .option("autoenablessl", "false") # disable SSL. 
          .load())

The above suggested solution didn't work for me, but disabling SSL did. I wish there was a better solution.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.