Symptom
- Error “Unable to connect to your Datasource. Check the connection details and user credentials, and then try again” appears when creating or editing a Snowflake Import Connection with SQL Databases, using Key Pair Authentication, in SAP Analytics Cloud.
- The following error could be found in Catalina logs:
"net.snowflake.client.core.SessionUtilKeyPair.extractPrivateKeyFromBytes Could not extract private key using Bouncy Castle provider
net.snowflake.client.jdbc.internal.org.bouncycastle.pkcs.PKCSException: unable to read encrypted data: <> not available: Cannot find any provider supporting AES/CBC/PKCS7Padding"
Environment
- SAP Analytics Cloud.
- Snowflake.
Reproducing the Issue
- Log in to SAP Analytics Cloud.
- Go to Connections and create or edit an Import Connection to Snowflake via SQL Databases.
- Save the connection.
>>Notice the following error occurring “Unable to connect to your Datasource. Check the connection details and user credentials, and then try again”.
Cause
The Java runtime was Java 8, which is not supported for Snowflake Import Connections using key pair authentication. The Snowflake JDBC driver requires Java 11+.
Resolution
- Upgrade the Java runtime used by the SAC Cloud Agent/Tomcat to SapMachine 21, which could be downloaded from Download SapMachine | SapMachine.
- Add the following Java options in Java command line settings to ensure compatibility:
-Dnet.snowflake.jdbc.enableBouncyCastle=true
--add-opens=java.base/java.nio=ALL-UNNAMED
See Also
Keywords
SAC, Snowflake, import connection, key pair authentication , KBA , LOD-ANA-AQU , Import Data Connections (Acquiring Data) , Problem
SAP Knowledge Base Article - Public