Error when running yum update "M2Crypto.SSL.SSLError: unknown protocol"
Environment
- Red Hat Enterprise Linux 5
Issue
- yum commands are not working to update
# yum list
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
Setting up repositories
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 102, in main
result, resultmsgs = do()
File "/usr/share/yum-cli/cli.py", line 359, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
File "/usr/share/yum-cli/yumcommands.py", line 160, in doCommand
ypl = base.returnPkgLists(extcmds)
File "/usr/share/yum-cli/cli.py", line 863, in returnPkgLists
ypl = self.doPackageLists(pkgnarrow=pkgnarrow)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 970, in doPackageLists
self.doRepoSetup()
File "/usr/share/yum-cli/cli.py", line 102, in doRepoSetup
yum.YumBase.doRepoSetup(self, thisrepo=thisrepo)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 299, in doRepoSetup
repo.setup(self.conf.cache)
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 503, in setup
self._loadRepoXML(text=self)
File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 530, in _loadRepoXML
cache=self.http_caching == 'all')
File "/usr/lib/yum-plugins/rhnplugin.py", line 208, in _YumRepository__get
start, end, copy_local, checkfunc, text, reget, cache)
File "/usr/lib/yum-plugins/rhnplugin.py", line 276, in _noExceptionWrappingGet
http_headers=headers,
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 927, in urlgrab
return self._retry(opts, retryfunc, url, filename)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 845, in _retry
r = apply(func, (opts,) + args, {})
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 913, in retryfunc
fo = URLGrabberFileObject(url, filename, opts)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1001, in __init__
self._do_open()
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1072, in _do_open
fo, hdr = self._make_request(req, opener)
File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1172, in _make_request
fo = opener.open(req)
File "/usr/lib64/python2.4/urllib2.py", line 358, in open
response = self._open(req, data)
File "/usr/lib64/python2.4/urllib2.py", line 376, in _open
'_open', req)
:
:
:
File "/usr/lib64/python2.4/httplib.py", line 804, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.4/httplib.py", line 827, in _send_request
self.endheaders()
File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line 145, in endheaders
HTTPSConnection.endheaders(self)
File "/usr/lib64/python2.4/httplib.py", line 798, in endheaders
self._send_output()
File "/usr/lib64/python2.4/httplib.py", line 679, in _send_output
self.send(msg)
File "/usr/lib64/python2.4/httplib.py", line 646, in send
self.connect()
File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line 161, in connect
self._start_ssl()
File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line 176, in _start_ssl
self.sock.connect_ssl()
File "/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Connection.py", line 149, in connect_ssl
return m2.ssl_connect(self.ssl, self._timeout)
M2Crypto.SSL.SSLError: unknown protocol
Resolution
- The system is not registered in RHN
Re-register the system by deleting the file '/etc/sysconfig/rhn/systemid' if present
# rhn_register
-
Disable Location Aware:
How to Disable Location Aware -
For RHEL 5.0 systems, update the package yum-rhn-plugin according to the errata:
yum-rhn-plugin bug fix -
Another reason to obtain this error message is that the /etc/sysconfig/rhn/up2date is pointing to the http protocol instead of https to use the certificate. Ensure the serverURL parameter has the https value
serverURL[comment]=Remote server URL
serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC
Diagnostic Steps
-
Check if the system is registered in RHN:
Registered System List
If it is not there, re-register the system. -
Make sure to have the valid Red Hat Network SSL CA certificate stored on your system. If your certificate is expired, please refer to this knowledge to obtain a new cert. To check the validity of /usr/share/rhn/RHNS-CA-CERT, run the following command:
# grep After /usr/share/rhn/RHNS-CA-CERT
Not After : Aug 26 02:10:55 2013 GMT
Not After : Feb 24 21:07:08 2020 GMT
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
