porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.51k stars 275 forks source link

Unable to connect to postgres DB from Keycloak which is FIPS enabled #841

Closed bipul-baishya closed 7 months ago

bipul-baishya commented 7 months ago

[Yesterday 10:48 PM] L, Rakesh 2024-04-03 17:15:04,952 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) Error details:: java.lang.RuntimeException: Failed to obtain JDBC connection

    at org.keycloak.quarkus.runtime.storage.database.jpa.AbstractJpaConnectionProviderFactory.getConnection(AbstractJpaConnectionProviderFactory.java:53)

    at org.keycloak.quarkus.runtime.storage.legacy.database.LegacyJpaConnectionProviderFactory.postInit(LegacyJpaConnectionProviderFactory.java:115)

    at org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory.init(QuarkusKeycloakSessionFactory.java:104)

    at org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication.startup(QuarkusKeycloakApplication.java:42)

    at org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver.onStartupEvent(QuarkusLifecycleObserver.java:37)

    at org.keycloak.quarkus.runtime.integration.QuarkusLifecycleObserver_Observer_onStartupEvent_b0e82415b143738dc1f986a5fa4668e83d0a5dea.notify(Unknown Source)

    at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:326)

    at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:308)

    at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:76)

    at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:131)

    at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:100)

    at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)

    at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)

    at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)

    at io.quarkus.runtime.Application.start(Application.java:101)

    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:110)

    at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)

    at org.keycloak.quarkus.runtime.KeycloakMain.start(KeycloakMain.java:103)

    at org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.run(AbstractStartCommand.java:37)

    at picocli.CommandLine.executeUserObject(CommandLine.java:1939)

    at picocli.CommandLine.access$1300(CommandLine.java:145)

    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)

    at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)

    at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)

    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)

    at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)

    at picocli.CommandLine.execute(CommandLine.java:2078)

    at org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun(Picocli.java:93)

    at org.keycloak.quarkus.runtime.KeycloakMain.main(KeycloakMain.java:89)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.base/java.lang.reflect.Method.invoke(Method.java:566)

    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:61)

    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32)

Caused by: org.postgresql.util.PSQLException: Could not initialize SSL context.

    at org.postgresql.ssl.LibPQFactory.<init>(LibPQFactory.java:188)

    at org.postgresql.core.SocketFactoryFactory.getSslSocketFactory(SocketFactoryFactory.java:61)

    at org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:34)

    at org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:584)

    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:168)

    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)

    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)

    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:247)

    at org.postgresql.Driver.makeConnection(Driver.java:434)

    at org.postgresql.Driver.connect(Driver.java:291)

    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:226)

    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:535)

    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:516)

    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)

    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)

    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

    at java.base/java.lang.Thread.run(Thread.java:829)

Caused by: java.security.KeyManagementException: FIPS mode: only SunJSSE KeyManagers may be used

    at java.base/sun.security.ssl.SSLContextImpl.chooseKeyManager(SSLContextImpl.java:167)

    at java.base/sun.security.ssl.SSLContextImpl.engineInit(SSLContextImpl.java:83)

    at java.base/javax.net.ssl.SSLContext.init(SSLContext.java:297)

    at org.postgresql.ssl.LibPQFactory.<init>(LibPQFactory.java:186)

    ... 17 more
porsager commented 7 months ago

I think you're in the wrong repo ;) This is a javascript PostgreSQL client.