yumのエラー解決法 [Errno 14] problem making ssl connection

yumを実行したときに[Errno 14] problem making ssl connectionが発生した場合、文字通りssl接続に問題があります。

エラー内容

[root@test ~]# yum XXXX
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
base                                                                                        | 3.7 kB     00:00
base/primary_db                                                                             | 4.7 MB     00:00
epel                                                                                        | 4.3 kB     00:00
http://download.fedoraproject.org/pub/epel/6/x86_64/repodata/XXX: 
[Errno 14] problem making ssl connection
Trying other mirror.
http://download.fedoraproject.org/pub/epel/6/x86_64/repodata/XXX: 
[Errno 14] Peer cert cannot be verified or peer cert invalid
Trying other mirror.

解決策

/etc/yum.repos.d/epel.repoに「sslverify=0」を追記すると解決することがあります。

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch 
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
sslverify=0 ← これを追記します。

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
~以下略~

sslverifyはSSL証明書をチェックするかどうかを決めていて、デフォルトではチェックするになっています。しかし、古いダウンロードサーバーになると、SSL証明書の期限が切れていることがあり、エラーになってしまうのです。