Closed StevenMassaro closed 10 months ago
I couldn't find a way to escape the #
. I tried URL encoding it, since the Snowflake driver will decode the values: https://github.com/snowflakedb/snowflake-jdbc/blob/master/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java#L91-L92, but that causes the following error: JWT token is invalid.
@StevenMassaro Are you still able to reproduce the issue with the latest JDBC driver version? And if yes, can you please provide me with the OS version and OpenSSL version?
Closing since no updates since Oct last year.
When using key pair authentication to connect to snowflake through jdbc, and using a special character (like
#
) in the URL causes an exception:Private key provided is invalid or not supported: rsa_key_bad2.p8: Cannot retrieve the PKCS8EncodedKeySpec
To reproduce this issue, set up key pair auth access to snowflake by following this page, and make sure to choose a password like
pass#ord
when generating the private key. (You may need to use these instructions to generate your keys: https://community.snowflake.com/s/article/Private-key-provided-is-invalid-or-not-supported-rsa-key-p8--data-isn-t-an-object-ID)Then, using the newly generated private and public keys, try to connect to Snowflake using this sample Java program, making sure to replace the placeholder values with your values for
URL
,KEYFILE
, andKEYPWD
:You should get the following exception: