Bug 15584 - ajenti unable to log in (gevent/python 2.7.9 ssl issue)
Summary: ajenti unable to log in (gevent/python 2.7.9 ssl issue)
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Joseph Wang
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-30 09:52 CEST by claire robinson
Modified: 2015-04-03 23:27 CEST (History)
1 user (show)

See Also:
Source RPM: ajenti
CVE:
Status comment:


Attachments
patch from upstream (1.41 KB, patch)
2015-04-01 00:11 CEST, Philippe Makowski
Details | Diff

Description claire robinson 2015-03-30 09:52:50 CEST
Tested ajenti, the headline control panel software which has been added in mga5. It installs with ssl used by default on port 8000, with a default username/password.

Starting ajenti service and attempting to open https://hostname:8000 in a browser shows the connection is dropped.

Stopping the ajenti service and starting manually in the foreground shows a python traceback when the browser attempts to connect. Googling suggests this is due to an issue in python but there is an ajenti bug report with matching traceback.

http://support.ajenti.org/topic/510059-ajenti-troubleshooting/

"This is a Gevent bug which prevents SSL working under Python 2.7.9 (in-dev).
I've committed a patch that will fix this problem, and preparing a pull request for gevent devs. In the meanwhile, you can disable SSL, downgrade Python to 2.7.8 or run Ajenti from git source."

There is also a debian bug report for python which I verified is valid in mga5.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762010

$ python
Python 2.7.9 (default, Dec 14 2014, 10:12:16) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> help(ssl._ssl.sslwrap)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'sslwrap'

This seems to be the gevent bug report (joequant)
https://github.com/gevent/gevent/issues/477

I confirmed that disabling ssl in ajenti /etc/ajenti/config.json does allow connection and login with the initial default credentials (root/admin).
claire robinson 2015-03-30 09:54:21 CEST

CC: (none) => makowski.mageia

Comment 1 Philippe Makowski 2015-03-30 15:21:59 CEST
here the Python bug and patch
http://bugs.python.org/issue22523
https://hg.python.org/cpython/rev/1a36d4e8cf4e

just need to apply it to Python 2.7.9 package
Comment 2 claire robinson 2015-03-31 09:46:13 CEST
Will you be able to apply it Philippe please?
Comment 3 Philippe Makowski 2015-03-31 18:57:37 CEST
only for mga5 ?
Comment 4 claire robinson 2015-03-31 19:00:15 CEST
Looks to be the same in mga4.

$ python
Python 2.7.9 (default, Dec 13 2014, 22:06:10) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> help(ssl._ssl.sslwrap)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'sslwrap'
claire robinson 2015-03-31 19:01:23 CEST

Whiteboard: (none) => MGA4TOO

Philippe Makowski 2015-03-31 19:07:46 CEST

Assignee: joequant => makowski.mageia

Comment 5 Philippe Makowski 2015-03-31 23:53:54 CEST
Sorry I was wrong, the fix have to be in ajenti 
Python will not restore _sslwrap http://bugs.python.org/issue22438

The patch for ajenti is https://github.com/Eugeny/ajenti/commit/54442ccb2b9ee24af15500557e7dd7b2f58acb97

https://github.com/Eugeny/ajenti/issues/578

Assignee: makowski.mageia => joequant
Source RPM: ajenti, python => ajenti

Philippe Makowski 2015-03-31 23:54:12 CEST

Whiteboard: MGA4TOO => (none)

Comment 6 Philippe Makowski 2015-04-01 00:11:27 CEST
Created attachment 6169 [details]
patch from upstream
Comment 7 claire robinson 2015-04-03 17:13:49 CEST
Joseph, any input please.
Comment 8 Joseph Wang 2015-04-03 17:42:48 CEST
I'll apply the patch this weekend.
Comment 9 Joseph Wang 2015-04-03 18:02:32 CEST
It turns out to be a bit more complex since I have to pull in the entire new compat.py to get it to work.
Comment 10 claire robinson 2015-04-03 18:05:51 CEST
Thanks Joseph, this package is a "headline" one in mga5 so needs to be working for release.
Comment 11 Joseph Wang 2015-04-03 18:37:50 CEST
Just fixed it. and requested a freeze push.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 12 Manuel Hiebel 2015-04-03 22:21:17 CEST
reopened as it's not yet pushed

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 13 Manuel Hiebel 2015-04-03 23:27:39 CEST
now it is

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.