Skip to content

SNOW-3012806: Snowflake CLI does not use the private_key_file_pwd key in toml #2738

@costrouc

Description

@costrouc

SnowCLI version

main

Python version

Python 3.13.5

Platform

Linux-6.14.0-37-generic-x86_64-with-glibc2.39

What happened

The snowflake cli does not respect the private_key_file_pwd key in toml that is supported in the snowflake python connector

https://github.com/snowflakedb/snowflake-connector-python/blob/fef4999534be5180aa0e601a2a4cc2a95d1c2c0e/src/snowflake/connector/connection.py#L236-L237

The snow cli implementation is here

private_key_passphrase = SecretType(os.getenv("PRIVATE_KEY_PASSPHRASE", None))
if (
private_key_pem.value.startswith(ENCRYPTED_PKCS8_PK_HEADER)
and private_key_passphrase.value is None
):
raise ClickException(
"Encrypted private key, you must provide the "
"passphrase in the environment variable PRIVATE_KEY_PASSPHRASE"
)
.

Console output

NA

How to reproduce

Create a snowflake connections.toml file with private_key_file and private_key_file_pwd set and not have PRIVATE_KEY_PASSPHRASE set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions