Skip to content
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

Exception: Invalid encrypted private key or passphrase Error Code: 0018 #1006

Open
abhishekkh opened this issue Nov 20, 2024 · 0 comments
Open

Comments

@abhishekkh
Copy link

abhishekkh commented Nov 20, 2024

I am running a snowflake sink connector using strimzi operator and am unable to get past this error.

Connector config:

    snowflake.private.key: "${file:/opt/kafka/external-configuration/confluent.conf/snowflake_private_key}"
    snowflake.private.key.passphrase: "${file:/opt/kafka/external-configuration/confluent.conf/snowflake_private_key_passphrase}"

Verified the secrets are present in those file paths in the below format:

private_key

-----BEGIN ENCRYPTED PRIVATE KEY-----
64 characters per line with a new line char at the end.
-----END ENCRYPTED PRIVATE KEY-----

private_key_passhprase
Single line

Error:

Caused by: com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: [SF_KAFKA_CONNECTOR] Exception: Invalid encrypted private key or passphrase
Error Code: 0018
Detail: failed to decrypt private key. Please verify input private key and passphrase. Snowflake Kafka Connector only supports encryption algorithms in FIPS 140-2
Message: unable to decode base64 string: invalid characters encountered in base64 data
org.bouncycastle.util.encoders.Base64.decode(Unknown Source)
org.bouncycastle.util.io.pem.PemReader.loadObject(Unknown Source)
org.bouncycastle.util.io.pem.PemReader.readPemObject(Unknown Source)
org.bouncycastle.openssl.PEMParser.readObject(Unknown Source)
com.snowflake.kafka.connector.internal.EncryptionUtils.parseEncryptedPrivateKey(EncryptionUtils.java:34)
com.snowflake.kafka.connector.internal.InternalUtils.createProperties(InternalUtils.java:195)
com.snowflake.kafka.connector.internal.SnowflakeConnectionServiceFactory$SnowflakeConnectionServiceBuilder.setProperties(SnowflakeConnectionServiceFactory.java:71)
com.snowflake.kafka.connector.SnowflakeSinkConnector.start(SnowflakeSinkConnector.java:115)

I have verified the secrets work using snowsql

snowsql -u USER -a ACCOUNT -h ACCOUNT.us-east-1.snowflakecomputing.com -p 443 --private-key-path private_key_qa -P

Appreciate any help debugging this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant