Skip to content

[Bug] - Yum not respecting proxy_username/proxy_password in dnf.conf #918

Open
@pandel

Description

@pandel

Describe the bug
It is not possible to build a Docker image based on amazonlinux:2023 behind an authentication proxy. Yum (curl) always returns a HTTP 407 error, regardless of its configuration.

The proxy address itself is reachable inside the container (tested) and also seems to be read by yum, because I can provoke a connection error message when I misconfigure the proxy URL, but the authentication mechanism doesn't seem to work. Sadly, I cannot avoid the proxy authentication in any case.

To Reproduce
To reproduce the error you need to connect to the Internet via an authentication proxy and add the following to the Dockerfile before the first yum install command is being used:

RUN echo "proxy=http://<proxyserverurl>:<proxyport>" >> /etc/dnf/dnf.conf &&\
    echo "proxy_username=<proxyuser>" >> /etc/dnf/dnf.conf &&\
    echo "proxy_password=<proxypass>" >> /etc/dnf/dnf.conf

Expected behavior
According to this AWS re:Post documentation yum install should connect to the Internet using the proxy now.

Reported error

#8 1.421 error: Curl error (56): Failure when receiving data from the peer for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.6.20250203/x86_64/mirror.list [CONNECT tunnel failed, response 407] (https://cdn.amazonlinux.com/al2023/core/mirrors/2023.6.20250203/x86_64/mirror.list).
#8 1.422 Amazon Linux 2023 repository                    0.0  B/s |   0  B     00:00
#8 1.422 Errors during downloading metadata for repository 'amazonlinux':
#8 1.422   - Curl error (56): Failure when receiving data from the peer for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.6.20250203/x86_64/mirror.list [CONNECT tunnel failed, response 407]
#8 1.423 Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (56): Failure when receiving data from the peer for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.6.20250203/x86_64/mirror.list [CONNECT tunnel failed, response 407]

In my case, I do have to use this proxy inside my Dockerfile, as I don't have any possibility to directly connect to the Internet.

What can be done?

Regards,
Holger

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions