sqltools-snowflake-driver icon indicating copy to clipboard operation
sqltools-snowflake-driver copied to clipboard

OpenSSL Unknown Algorithm

Open reeseann opened this issue 3 years ago • 5 comments

Using keypair auth:

[1618273502356] ERROR (ext): ERROR: Error opening connection error:13000077:PKCS8 routines:OPENSSL_internal:UNKNOWN_ALGORITHM, {"code":-32001,"data":{"driver":"Snowflake","driverOptions":{}}}

Private key was generated using LibreSSL 2.8.3 in PKCS8 format

reeseann avatar Apr 13 '21 00:04 reeseann

Same error message for me. Key works everywhere else I use it (DBeaver, snowsql, dbt, etc).

jsteinfort-amd avatar Aug 17 '21 18:08 jsteinfort-amd

Same here. Anyone found a fix for this?

sashamitrovich avatar Aug 20 '21 09:08 sashamitrovich

If it's of any help, here's some possible details and possible workaround I found. Below are my notes from a year or so ago, so this is all I can offer, I don't remember other details

Specify the -v2 aes-256-cbc cipher algorithm when generating the private key. This only appears to be required for MacOS and/or LibreSSL (the OpenSSL implementation shipped with MacOS).

openssl genrsa -out snowflake_key 4096
openssl rsa -in snowflake_key -pubout -out snowflake_key.pub
openssl pkcs8 -topk8 -inform pem -in snowflake_key -outform PEM -v2 aes-256-cbc -out snowflake_key.p8

See https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs#keypair-authentication-passhrase

And also see Google search results for snowflake macos openssl libressl encrypt.

varun-dc avatar May 03 '23 13:05 varun-dc

I saw this when I was using "snowflake-sdk" npm module in my project. The fact this also uses it (I haven't used sqltools-snowflake-driver, or know anything about it, was just linked here and wanted to provide some possible help) is a bit suspicious. The root cause points to "snowflake-sdk" by this reasoning.

varun-dc avatar May 03 '23 13:05 varun-dc

Has anyone found a workaround to this issue? I still see the same situation: image

rmenendezm avatar Sep 20 '23 17:09 rmenendezm