Open NCCastillo opened 4 years ago
The PG JDBC driver pgjdbc
has its own properties, see: https://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters. From a cursory look, this seems to match what you mention above.
For activerecord-jdbc-adapter
, passing these options is a little different, they need to be in a properties
block:
production:
<<: *default
properties:
sslmode: allow
sslrootcert: <path to ssl root cert>
sslkey: <path to ssl key>
sslcert: <path to ssl cert>
(we do understand the sslmode
outside of properties
, but nothing else). That being said, I never tried a connection with a client certificate.
Our jruby rails app is receiving "ActiveRecord::JDBCError: FATAL: connection requires a valid client certificate" when trying to connect to postgres over ssl. I know there is some configuration to be done on the java side to allow a truststore/keystore.
I have tried to implement this and I am sure I am missing some configuration. I found this note which states:
Does anyone know how to implement this?
This is what I have done so far: jruby version:
jruby 9.2.7.0 (2.5.3) 2019-04-09 8a269e3 OpenJDK 64-Bit Server VM 25.252-b09 on 1.8.0_252-b09 +jit [linux-x86_64]
Rails version:
Rails 5.0.7.2
active record jdbc adapater:
activerecord-jdbc-adapter (50.7-java)
Setting up keystore:
On the rails side:
Start rails with java options to point to keystore:
Any suggestion would be greatly appreciated. I feel like I am close but I have been banging my head on this for a few days now.