Closed shahargl closed 1 year ago
Maybe you can take a look @sfc-gh-stan?
I have a better cache implementation written. I can pick this up soon!
Any updates regarding this?
To clean up and re-prioritize bugs and feature requests we are closing all issues older than 6 months as of March 1, 2023. If there are any issues or feature requests that you would like us to address, please re-create them. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using (
python --version
)?Python 3.7.3 (default, Apr 24 2020, 18:51:23)
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.platform())'
)?Darwin-19.5.0-x86_64-i386-64bit
What are the component versions in the environment (
pip freeze
)?When a connection is being made, the OCSP validation mechanism triggered because the snowflake-connector wraps the default python SSL mechanism:
The bug is that if the cache already exists, the
oscp_snowflake
updates the cache although there is nothing to update - the certificate is already cached and no state is being changed.The stack trace is:
And looking on
read_ocsp_response_cache_file
:It uses
decode_ocsp_response_cache
with the cache (json.load(f)
) as the parameter.The problem is that
decode_ocsp_response_cache
doesn't distinguish between a real response (which comes from a server) to a cached response (which comes from a file):And than
is being triggered no matter the input source.
This is a huge problem for us because we use multi-threaded Flask server with SQLAlchemy, and these
update_or_delete_cache
creates A LOT of locks which, in some circumstances create a timeout.In addition, I think it's a security issue because the certificate timestamp being update although no server verification ever made.
What did you expect to see? The cache should be updated only if the certificates come from a server, via
_download_ocsp_response_cache
:What did you see instead? The cache being updated based on... itself
Can you set logging to DEBUG and collect the logs? There are a huge amount of logs in our ELK, which you can discuss with us (anecdotes.ai) and we'll demonstrate the issue.