docker / docker/docker-py

SSLError DECRYPTION_FAILED_OR_BAD_RECORD_MAC on random requests

Open
#2,411 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

I'm running docker-py (docker==4.0.2) from within an alpine:2.8 container.

My python version is 2.7.15, python is using LibreSSL 2.7.5 (import ssl; print(ssl.OPENSSL_VERSION)) and my docker version is 18.09.7.

The client is connecting to a TCP listener, running on another host.

I connect as follows:
client = docker.from_env(environment={"DOCKER_HOST":DOCKER_HOST,"DOCKER_TLS_VERIFY":True,"DOCKER_CERT_PATH":DOCKER_CERT_PATH})

On random requests (around every 10th), when verifying an image's running state using client.containers.get(name) I received the following exception:

SSLError(MaxRetryError("HTTPSConnectionPool(host='docker.local', port=2376): Max retries exceeded with url: /v1.35/containers/a5687f34d0/json (Caused by SSLError(SSLError(1, u'[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1941)'),))",),)

If I resend the exact same request (i.e. just press the button again, changing nothing), it works without an exception. However, the exception will return after around 10 more requests.

Does anyone have any idea what could be causing this exception or how I can fix it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the intermittent failure at client.containers.get(name) with the shown docker.from_env environment, Alpine 2.8, Python 2.7.15, and LibreSSL 2.7.5. Trace the failing TLS request and compare it with a successful retry; the issue is done when the cause of the record-MAC error and a verified fix or workaround are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.