desktop-packages team mailing list archive
-
desktop-packages team
-
Mailing list archive
-
Message #94552
[Bug 1394244] Re: pycurl gives 'gnutls_handshake() warning: The server name sent was not recognized', curl on command line and wget work with same URL
This bug was fixed in the package system-config-printer -
1.5.1+20141010-0ubuntu2.2
---------------
system-config-printer (1.5.1+20141010-0ubuntu2.2) utopic-proposed; urgency=medium
* debian/patches/70_package-download-fixes.patch: Fixed several bugs to
make automatic printer driver download working again (LP: #1401835):
o Use pyrequests instead of pycurl for secure (verified certificate)
downloads. pycurl stopped working after the OpenPrinting web server
has moved from Ubuntu 10.04 to 12.04 (LP: #1394244).
o In the install-printerdriver script improved the check for the
necessity of adding the driver's Debian repository and added a
workaround for a bug in aptdaemon interpreting PackageKit's package
IDs wrongly when installing a package (LP: #1397750).
o In fillDriverList() use ".hasattr()" to check presence of
attributes.
o Python3 transition bugs
* debian/patches/73_support-non-utf-8-encoded-ppds.patch: Do not
crash on non-UTF-8-encoded PPD files (LP: #1400232)
* debian/control: Depend on python-requests instead of on python-pycurl.
-- Till Kamppeter <till.kamppeter@xxxxxxxxx> Sat, 13 Dec 2014 11:01:26 +0100
** Changed in: system-config-printer (Ubuntu Utopic)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to system-config-printer in Ubuntu.
https://bugs.launchpad.net/bugs/1394244
Title:
pycurl gives 'gnutls_handshake() warning: The server name sent was not
recognized', curl on command line and wget work with same URL
Status in pycurl package in Ubuntu:
New
Status in system-config-printer package in Ubuntu:
Fix Released
Status in pycurl source package in Trusty:
New
Status in system-config-printer source package in Trusty:
In Progress
Status in pycurl source package in Utopic:
New
Status in system-config-printer source package in Utopic:
Fix Released
Bug description:
From a Python program (system-config-printer) I need to access an
https URL (on OpenPrinting) assuring that the answer really comes from
OpenPrinting and not from an attacker. This serves for automatically
downloading and installing driver packages for detected and locally
unsupported printers.
A typical URL sent by system-config-printer to find driver packages
for a detected printer is
https://www.openprinting.org/query.cgi?moreinfo=1&showprinterid=1&onlynewestdriverpackages=0&architectures=amd64&noobsoletes=1&onlyfree=0&onlymanufacturer=0&onlydownload=1&packagesystem=deb&onlysigneddriverpackages=0&format=xml&type=drivers&printer=MFG:EPSON;MDL
:EP-805A%20Series;DES:EPSON%20EP-805A%20Series;CLS:PRINTER;
The "https://..." allows for checking whether the answer really comes
from OpenPrinting. It is no problem accessing this URL with a browser
or by the command line:
curl
'https://www.openprinting.org/query.cgi?moreinfo=1&showprinterid=1&onlynewestdriverpackages=0&architectures=amd64&noobsoletes=1&onlyfree=0&onlymanufacturer=0&onlydownload=1&packagesystem=deb&onlysigneddriverpackages=0&format=xml&type=drivers&printer=MFG:EPSON;MDL
:EP-805A%20Series;DES:EPSON%20EP-805A%20Series;CLS:PRINTER;'
wget
'https://www.openprinting.org/query.cgi?moreinfo=1&showprinterid=1&onlynewestdriverpackages=0&architectures=amd64&noobsoletes=1&onlyfree=0&onlymanufacturer=0&onlydownload=1&packagesystem=deb&onlysigneddriverpackages=0&format=xml&type=drivers&printer=MFG:EPSON;MDL
:EP-805A%20Series;DES:EPSON%20EP-805A%20Series;CLS:PRINTER;'
In all cases I get an XML data set in a reasonable amount of time (so
server performance is OK). The XML data set tells about a driver
package from Epson with all info to download it and to establish
automatic updates via the facilities of the distro. RPM- and DEB-based
distros with 32-bit or 64-bit Intel architectures are supported.
system-config-printer is written completely in Python and uses the
pycurl library to call the URL with verification that the
communication is done with the actual OpenPrinting server. This does
not work any more. If I run the following simple Python code it fails:
----------
import pycurl
def collect_data(result):
print(result)
return len(result)
curl = pycurl.Curl()
curl.setopt(pycurl.SSL_VERIFYPEER, 1)
curl.setopt(pycurl.SSL_VERIFYHOST, 2)
curl.setopt(pycurl.WRITEFUNCTION, collect_data)
curl.setopt(pycurl.URL, 'https://www.openprinting.org/query.cgi?moreinfo=1&showprinterid=1&onlynewestdriverpackages=0&architectures=amd64&noobsoletes=1&onlyfree=0&onlymanufacturer=0&onlydownload=1&packagesystem=deb&onlysigneddriverpackages=0&format=xml&type=drivers&printer=MFG:EPSON;MDL:EP-805A%20Series;DES:EPSON%20EP-805A%20Series;CLS:PRINTER;')
status = curl.perform()
repr(status)
quit()
----------
You can paste the lines into a text editor to get a Python program or
run "python" or "python3" (Python version seems not to matter) and
paste the bunch of lines to the prompt.
The result is always the same, the "status = curl.perform()" line
gives:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pycurl.error: (51, 'gnutls_handshake() warning: The server name sent was not recognized')
For me it looks like that something has changed, as formerly this
Python code worked correctly.
If I change "https://..." to "http://..." all works correctly and I
get the XML data, but then there is no verification any more that the
communication is really done with OpenPrinting.
See also
http://stackoverflow.com/questions/568247/pycurl-fails-but-curl-from-
bash-works-in-ubuntu
This all looks like a bug in pycurl.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pycurl/+bug/1394244/+subscriptions