Connecting to snowflake destination as a key value...
# replication-troubleshooting
f
Connecting to snowflake destination as a key value pair and getting the following error now after uploading key file: Could not connect with provided configuration. net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid or not supported: rsa_key.p8: PBE parameter parsing error: expecting the object identifier for AES cipher
k
This error indicates the private key file you uploaded is encrypted with a cipher/format the Snowflake JDBC driver can’t parse. Generate the key in PKCS#8 PEM as Snowflake expects. Options: - Use an unencrypted PKCS#8 key: - openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt - Or use an encrypted PKCS#8 key with a supported cipher (e.g., aes-256-cbc), and be sure to provide the key password in the destination config: - openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -v2 aes-256-cbc -out rsa_key.p8 Then derive and register the public key on the Snowflake user: - openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub - alter user <user_name> set rsa_public_key=<public_key_value>; If you use an encrypted key, fill in “private key password” in the Airbyte Snowflake destination. If you still see the parsing error, regenerate the key with one of the commands above to avoid unsupported encryption parameters (the “PBE parameter parsing error” is typical of incompatible encryption settings) ([Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication)).
f
@kapa.ai this is what I used to generate the key and it is still erroring out: openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out rsa_key.p8
k
A message from kapa.ai
DES3-encrypted PKCS#8 keys can trigger Snowflake JDBC parsing errors. Use one of the formats shown in the docs: - Unencrypted PKCS#8 (simplest): - openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt - Encrypted PKCS#8 with aes-256-cbc (and provide the private key password in the Airbyte Snowflake destination config): - openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -v2 aes-256-cbc -out rsa_key.p8 After generating the key, derive the public key and set it on the Snowflake user: - openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub - alter user <user_name> set rsa_public_key=<public_key_value>; The error you saw (“PBE parameter parsing error”) is consistent with an incompatible encryption scheme; switching to unencrypted or aes-256-cbc resolves this per guidance (Key pair authentication). ([Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication))
f
@kapa.ai I used aes encryption but getting this error message now: Could not connect with provided configuration. net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Private key provided is invalid or not supported: rsa_key.p8: PBES2 SecretKeyFactory not available
k
A message from kapa.ai
This error points to an encrypted PKCS#8 key using an algorithm/JCE provider that the Snowflake JDBC driver (as used by the Airbyte Snowflake destination) can’t handle. The Airbyte docs recommend either: - Unencrypted PKCS#8 (avoids JCE/provider issues): - openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt - Encrypted PKCS#8 with aes-256-cbc (and supply the private key password in the destination config): - openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -v2 aes-256-cbc -out rsa_key.p8 Then generate and register the public key on the Snowflake user: - openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub - alter user <user_name> set rsa_public_key=<public_key_value>; If you still see “PBES2 SecretKeyFactory not available,” regenerate the key unencrypted (-nocrypt) as a quick workaround; this format is explicitly documented and avoids PBES2 dependencies (Key pair authentication). ([Key pair authentication](https://docs.airbyte.com/integrations/sources/snowflake#key-pair-authentication))