The ssl_verify key in the remote config gets passed through to the S3FileSystem client_kwargs:
https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/fs/s3.py#L105
https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/fs/fsspec_wrapper.py#L17
https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/fs/s3.py#L154
These are in turn passed to the aiobotocore.AioSession :
https://github.com/dask/s3fs/blob/a3d7a946f85b6dbef62ab75c61fe1319a482c8ba/s3fs/core.py#L366
In the AioSession it checks if the verify key is set and if it isn't then it looks in the aws config:
https://github.com/aio-libs/aiobotocore/blob/2a7c7f5a8c7a61daebe484bc5a6f2232607af82c/aiobotocore/session.py#L70-L71
verify can either be a boolean or a string, with the latter being a path to a custom CA bundle:
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html (see the verify argument of the client method.)
However, the config schema for DVC only allows boolean for ssl_verify and defaults true:
https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/config_schema.py#L148
The result is that the aws config is never checked and a custom CA bundle cannot be used. If such a CA bundle is needed when trying to communicate to remote (e.g. using push or pull) the result is
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
I ran into this problem because my company uses a self-hosted S3 clone with a bundle of internally signed certificates. Setting the AWS_CA_BUNDLE environment variable did not resolve the issue. But modifying the config schema to accept a string:
Optional("ssl_verify", default=True): Any(Bool, str),
and running
dvc remote modify object-store ssl_verify "$HOME/.aws/cabundle.pem"
resolved the issue for me.
I'm happy to open a pull request to make the change to the config schema if that solution is acceptable, but it would be my first contribution (for any OSS project!), so it'll take extra time for me to setup my environment, etc.
The
ssl_verifykey in the remote config gets passed through to theS3FileSystemclient_kwargs:https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/fs/s3.py#L105
https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/fs/fsspec_wrapper.py#L17
https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/fs/s3.py#L154
These are in turn passed to the
aiobotocore.AioSession:https://github.com/dask/s3fs/blob/a3d7a946f85b6dbef62ab75c61fe1319a482c8ba/s3fs/core.py#L366
In the AioSession it checks if the
verifykey is set and if it isn't then it looks in the aws config:https://github.com/aio-libs/aiobotocore/blob/2a7c7f5a8c7a61daebe484bc5a6f2232607af82c/aiobotocore/session.py#L70-L71
verifycan either be a boolean or a string, with the latter being a path to a custom CA bundle:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html (see the
verifyargument of theclientmethod.)However, the config schema for DVC only allows boolean for
ssl_verifyand defaults true:https://github.com/iterative/dvc/blob/89b40afee740146af42efeb8563c08053f984a88/dvc/config_schema.py#L148
The result is that the aws config is never checked and a custom CA bundle cannot be used. If such a CA bundle is needed when trying to communicate to remote (e.g. using push or pull) the result is
I ran into this problem because my company uses a self-hosted S3 clone with a bundle of internally signed certificates. Setting the
AWS_CA_BUNDLEenvironment variable did not resolve the issue. But modifying the config schema to accept a string:and running
resolved the issue for me.
I'm happy to open a pull request to make the change to the config schema if that solution is acceptable, but it would be my first contribution (for any OSS project!), so it'll take extra time for me to setup my environment, etc.