Tried to connect Java application to DB. Nonreactive jdbc works perfectly. Reactive stuff is forced for SSL.
Looks like the configuration of the Database is incorrect.
The application uses two different connections to work. Flyway got applied, quartz works, reactive driver failed.
Any thoughts?
jmo
May 11, 2023, 11:21pm
2
Can you provide an error message, example code, and/or stack trace?
2023-05-12T17:30:26.143Z DEBUG 7 — [reactor-tcp-epoll-4] i.r.p.client.ReactorNettyClient : [cid: 0x8] Response: ErrorResponse{fields=[Field{type=SEVERITY_LOCALIZED, value=‘FATAL’}, Field{type=SEVERITY_NON_LOCALIZED, value=‘FATAL’}, Field{type=CODE, value=‘08004’}, Field{type=MESSAGE, value=‘Must use SSL’}, Field{type=DETAIL, value=‘Connecting via SSL ’}, Field{type=HINT, value=‘Add ?sslmode=require to your connection string’}]}
spring:
flyway:
locations: classpath:db/migration
url: jdbc:postgresql://${SMB_PL_DB_HOST}:${SMB_PL_DB_PORT}/${SMB_PL_DB_DATABASE}
user: ${SMB_PL_DB_USER_NAME}
password: ${SMB_PL_DB_PASSWORD}
enabled: true
jooq:
sql-dialect: postgres
r2dbc:
name: ${SMB_PL_DB_DATABASE}
url: r2dbc:postgresql://${SMB_PL_DB_HOST}:${SMB_PL_DB_PORT}/${SMB_PL_DB_DATABASE}?ssl=true&sslmode=require&sslcert=${SSL_DB_CERT}
username: ${SMB_PL_DB_USER_NAME}
password: ${SMB_PL_DB_PASSWORD}
flyway works (non reactive). r2dbc jooq does not. I tried to specify the downloaded db_cert implicitly. No success.
Tried this certificate from docu:
[xxx]# openssl x509 -noout -fingerprint -sha256 -inform pem -in db_server.crt
sha256 Fingerprint=58:94:FF:67:32:C6:88:2B:78:82:0A:D7:5F:B5:55:3B:E5:DA:12:B8:2C:CA:78:8E:D0:77:E2:FA:26:2A:80:D5
Ok it was resolved. The application worked incorrectly with the DB name (slash inside is awful) and SSL cert path.
It is mandatory to have ssl: true, sslMode: require and sslKey: (pem format)
jmo
May 12, 2023, 11:51pm
6
Yep, makes sense. For reference,
bit.io works with a lot of different Postgres-compatible tools, but many of those tools have different connection requirements. Connection errors most likely mean that you need to tweak a setting or two, not that the client is incompatible with...