-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1909756: Unable to connect with key pair authentication #2061
Comments
Hello @tosehee , Thanks for raising the issue. The error mentions "1.2.840.113549.1.5.13", which corresponds to PBES2 encryption, and snowflake driver expects TripleDES (DESede). Could you please check how you encrypted the key. Could you please share the code snippet and jdbc log. How did you generate the key ? did you add bouncy castle jar files ? Regards, |
I followed the Snowflake's doc word for word. To create pk
To create pub key
And yes. Bouncy castle jar is in the classpath along with latest Snowflakes's Driver.
|
Hello @tosehee , Thanks for the update. Regards, |
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of JDBC driver are you using? -> 3.22.0
What operating system and processor architecture are you using? Mac OSX
What version of Java are you using? Java 17
What did you do?
I am using the Hikari + Snowflake JDBC Drivers to connect using key pair authentication.
config.addDataSourceProperty("private_key_base64", privateKey);
config.addDataSourceProperty("private_key_pwd", privateKeyPw);
where "config" is the HikariHikariConfig.
When trying to connect, I get the following error.
Caused by: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid or not supported: net.snowflake.client.jdbc.internal.org.bouncycastle.operator.OperatorCreationException: 1.2.840.113549.1.5.13 not available: Wrong algorithm: DESede or TripleDES required
at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initialize(DefaultSFConnectionHandler.java:136) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initializeConnection(DefaultSFConnectionHandler.java:104) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
at net.snowflake.client.jdbc.SnowflakeConnectionV1.initConnectionWithImpl(SnowflakeConnectionV1.java:155) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
at net.snowflake.client.jdbc.SnowflakeConnectionV1.(SnowflakeConnectionV1.java:132) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
Connect to Snowflakes DB.
Caused by: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid or not supported: net.snowflake.client.jdbc.internal.org.bouncycastle.operator.OperatorCreationException: 1.2.840.113549.1.5.13 not available: Wrong algorithm: DESede or TripleDES required
at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initialize(DefaultSFConnectionHandler.java:136) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initializeConnection(DefaultSFConnectionHandler.java:104) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
at net.snowflake.client.jdbc.SnowflakeConnectionV1.initConnectionWithImpl(SnowflakeConnectionV1.java:155) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
at net.snowflake.client.jdbc.SnowflakeConnectionV1.(SnowflakeConnectionV1.java:132) ~[snowflake-jdbc-3.22.0.jar!/:3.22.0]
The text was updated successfully, but these errors were encountered: