1

I was able to connect to the Snowflacke database and ran queries in Python via Snowflake python connector.

The problem was when I was fetching data by cursor.fetch(), it gave me this error when I did not limit the queries:

SSLError: HTTPSConnectionPool(host='XXXXXXXXXXXXXX.blob.core.windows.net', port=443): 
Max retries exceeded with url: /results/XXX..XXX=https&se=2022-1012...&sr=b&sp=r&sig=X...X%2XX.XX=gzip 
(Caused by SSLError(SSLError("bad handshake: Error([('SSL routines','tls_process_server_certificate', 'certificate verify failed')])")))

If I limited the query by, for example, LIMIT 300, I was able to fetchall() the rows. I am guessing if there is a size limit for the SSL connection configuration on my machine.

Thank you so much if anyone have any advices.

Wren
  • 11
  • 2

1 Answers1

1

Result sets over a certain size are dumped to the internal stage (for performance reasons) of the Snowflake account and the connector is instructed to retrieve them from there.

As Snowflake’s security model does not allow Secure Sockets Layer (SSL) proxies interception, the solution is usually to whitelist all Snowflake account related URLs that can be retrieved by running the following command from Snowflake UI:

SELECT SYSTEM$WHITELIST();

or for Privatelink accounts:

SELECT SYSTEM$WHITELIST_PRIVATELINK();

The hostnames present in the output of the above command need to be whitelisted at proxy level.

Sergiu
  • 4,039
  • 1
  • 13
  • 21