This one gave me too much trouble, and for some reason there were not many helpful google results so I’m documenting it here.
At work servers are allowed to connect to the internet only through https on port 443. This means that yum repo’s must be configured to connect to a secured mirror. If you are working under these circumstances hopefully there is a mirror for your repository that allows a https connection. In my case I was simply trying to access Fedoras EPEL and luckly redhat allows https for this repo at https://dl.fedoraproject.org/pub/epel/
Run your repo RPM (In this case epel-release-5-4.noarch.rpm)
cd /etc/yum.repos.d/
delete file called epel-testing.repo
open epel.repo and change the file to represent the following:
[epel]
name=Extra Packages for Enterprise Linux 5 – $basearch
baseurl=https://dl.fedoraproject.org/pub/epel/5/$basearch
enabled=1
failovermethod=priority
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
and save.
make sure to run yum clean-all just in case