Open michalvavrik opened 6 months ago
/cc @Karm (securepipeline), @geoand (devservices), @jerboaa (securepipeline), @stuartwdouglas (devservices)
Root cause is:
Caused by: java.sql.SQLException: Cannot find any provider supporting RSA/ECB/OAEPWithSHA-1AndMGF1Padding
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:815)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:438)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:189)
at org.testcontainers.containers.JdbcDatabaseContainer.createConnection(JdbcDatabaseContainer.java:253)
... 22 more
Cipher RSA/ECB/OAEPWithSHA-1AndMGF1Padding
is not available with the SunPKCS11-NSS-FIPS
provider. I'd suggest to massage the driver to use a more portable one.
Describe the bug
I cannot leverage Dev Services for MySQL when I develop my Quarkus application in FIPS-enabled environment. Quarkus JDBC MySQL extension works in FIPS-enabled environment (team I belong to run several tests that use MySQL in FIPS-enabled environment), however the dev service rely on TestContainers version that doesn't work in FIPS-enabled environment by default . I think it's similar thing that happened to Quarkus in past (see https://github.com/quarkusio/quarkus/issues/32910). The default authentication plugin used unsupported cipher. See how Camel tests worked around that https://github.com/apache/camel-quarkus/pull/6063 https://github.com/apache/camel-quarkus/issues/6061 https://github.com/apache/camel-quarkus/issues/6062.
Expected behavior
My team also uses TestContainers and experienced the same issue. The easiest workaround was to use log message as a waiting strategy (see here for a working example https://github.com/quarkus-qe/quarkus-test-suite/pull/1782/files#diff-162fe6553bac44cb3d154600cad3a11e4102ee420ff0460e1deb1659e88dbbcc ). However there are other workarounds like these that Camel Quarkus tests did. I also suppose there is a proper solution as well, but I will leave that to experts.
Personally I think it would be nice to be able to develop with the same environment setup as the application is going to run and Quarkus could make it easier with the Dev Service.
Actual behavior
Waiting for database connection timeouts, Quarkus cannot detect that the database is ready even though it is:
How to Reproduce?
Steps to reproduce (you need FIPS-enabled environment):
Output of
uname -a
orver
Fedora 38
Output of
java -version
Red_Hat-17.0.10.0.7-1.el7openjdkportable
Quarkus version or git rev
3.10, 3.8.4
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.4
Additional information
No response