If you are building a rust binary app that uses rusoto for AWS features, and you happen to be crafting a Dockerfile for others to use your app, then you might run into a strange SSL error when running your app in the docker container. It might look like this:

thread 'main' panicked at 'Package not found or unable to connect
to s3: The OpenSSL library reported an error'

The error is pretty vague but it still yields some clues as to what is going on - namely that there is an issue with the SSL connection to s3. I searched for some time trying to get a clue about what might have been happening and eventually landing on the following post on StackOverflow: Docker and “The OpenSSL library reported an error” when deployed. This provided a crucial piece of information: SSL_CERT_DIR is used to know where the certs live and a quick echo in my docker container returned an empty value.

This all leads to the important fact to resolve the rusoto ssl issues. Make sure to include the SSL_CERT_DIR environment variable in your Dockerfile.

ENV SSL_CERT_DIR=/etc/ssl/certs

Now you can enjoy using docker to run your binary and get the full benefit of AWS connectivity!