[BUG] implementation of hashlib in _utils.py fails in FIPS environment #2697
Description
Describe your context
CentOS FIPS environment
Python 3.11.5
dash
dash-bootstrap-components
dash-leaflet
numpy
pandas
plotly
pyproj
scipy
xarray
tables
Describe the bug
When deployed using rstudio-connect, the app fails to initialize with the following error:
...dash/_utils.py", line 144, in _concat hashed_inputs = hashlib.md5( ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
The error can be replicated simply with python3 in a similar environment, as was done in this redhat bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1744670
There is a fair amount of discussion about this issue in other projects (where reporters on average do a better job of describing the issue):
dask/dask#8608
Linuxfabrik/lib#30
PrefectHQ/prefect#7615
Where the suggested fix is to use a different hasher (e.g. blake3) or using the hashilb.md5 optional flag used_for_security=False (python>=3.9) if you're not hashing sensitive data. I for some reason did not see this error while in python 3.8. I believe this is a necessary fix to make dash compatible with FIPS environments.