Could not read private key with value passed in connection string
See original GitHub issueIssue description
After upgrading from version 2.0.13 to 2.0.20, the same C# code we use to pass a private key via the connection string now fails.
Example code
We build the connection string with the below C# code, which works fine with version 2.0.13.
var connectionString = $"account={account};host={snowflakeBaseURL};warehouse={c.ServerName};role={role};db={c.DatabaseName};schema={schema};user={c.UserName};authenticator=snowflake_jwt;private_key={certificate};{certPasswordField}";
Error log
Exception:
Snowflake.Data.Client.SnowflakeDbException: 'Error: Could not read private key with value passed in connection string. \n Error : incorrect private key value or private key format: use "\n" for newlines and double the equals sign. SqlState: , VendorCode: 270052, QueryId: '
InnerException:
IOException: base64 data appears to be truncated
Configuration
Driver version: 2.0.20
Issue occurs with: net472, net5.0, net6.0
Server version: 7.2.0
Client OS: Windows 10 Enterprise
Issue Analytics
- State:
- Created 8 months ago
- Comments:6
Top Results From Across the Web
Could not read private key with value passed in connection ...
ERROR. Snowflake.Data.Client.SnowflakeDbException: "Could not read private key with value passed in connection string. \\n Error : System.
Read more >Pyspark: Error Connecting to Snowflake using Private Key
Just got a chance to try this out, and I'm getting the following error: JDBC driver not able to connect to Snowflake. Error...
Read more >Support for Public/Private Key Pair Authentication · Issue ...
I am trying this on Linux now, because the Windows ODBC Driver Manager has issues with the PWD field, according to Snowflake. In...
Read more >Unable to connect to SQL Server with encryption enabled ...
Going back to .NET 5 and Microsoft.Data.SqlClient 3.0.1 fixes the issue. Even after disabling encryption on the server we still receive the same ......
Read more >Configure a connection string - Azure Storage
Navigate to Security + networking > Access keys in your storage account's settings to see connection strings for both primary and secondary ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello,
Thanks for the details. After following those details, it seems we no longer have this issue with driver version 2.0.22.
Thanks,
Randall
@sfc-gh-spanaite the documentation is not up to date for this, thankfully found this issue