4

So we've got this yum repo that is protected via basic auth. My yum.repo definition looks like this

[custom-repo]
name=Releases Repository
baseurl=http://user:password@our-corporate-yum.devops.company.com:8080/mrepo/nexus-noarch/RPMS.releases-rpm/
enabled=1
gpgcheck=0
sslverify=0

Yum is able to pull the metadata and find the packages on my repo. I even confirmed via a sniffer that the correct basic auth is happening. But when I try to install a package it fails with the typical 401.

From the message shown and from the info grabbed from the sniffer I can tell that no authentication is been used at all.

Total download size: 34 M
Installed size: 39 M
Downloading packages:
http://user:password@our-corporate-yum.devops.company.com:8080/mrepo/nexus-noarch/RPMS.releases-rpm/com/company/artifact/xxxxx/0.9-SNAPSHOT/artifact-0.9-20140515.171948-39-   rpm.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 401 Unauthorized"
Trying other mirror.

Based on yum.conf I also tried adding username and password params as described there, but that didn't work.

What is that that I'm doing wrong?

Any ideas?

Cheers!

maverick
  • 161
  • 1
  • 4
  • 1
    Which `yum` version? Also, there could be a problem with using basic auth *and* a non-default port, see: http://stackoverflow.com/questions/10182050/yum-client-configuration-how-to-use-basic-authentication-with-a-port-other-than – faker Jul 02 '14 at 13:30
  • @faker thanks for link, I'm using `yum-3.4.3-137.51.amzn1.noarch`, I'll try a workaround to avoid the port number and see if that works. – maverick Jul 02 '14 at 14:24
  • 1
    Well I can confirm that port is not the issue. Even when using the default port the same error happen again. After peeking at `/var/cache/yum/x86_64/2014.03/custom-repo/repomd.xml` I see all the url's there have no auth info included. Should it be there? shouldn't be yum using the one base url provided? or the `username` and `password` provided? – maverick Jul 02 '14 at 15:57
  • Using other browsers, can you then download the file which yum cant? – Petter H Jul 02 '14 at 17:10
  • @PetterH yes I can, using the credentials in the url as `http://username:password@host..` – maverick Jul 02 '14 at 18:40

1 Answers1

2

For anyone interested the problem is related to our nexus repo and this bug.

maverick
  • 161
  • 1
  • 4