pycurl built with gnutls not working as openssl (error: gnutls_handshake() failed)

Bug #1111673 reported by Jorge
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pycurl (Debian)
Fix Released
Unknown
pycurl (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

A call to that lib returns problem in gnutls_handshake(). The problem is that pycurl was built with gnutls. Building it with openssl the problem disappear. Below there is a 'how to' to build with openssl, replacing some calls to gnutls with calls to openssl.

Details:

I'm trying to use 'git' and a server set up with apache+SSL. When I try to clone a repository I get the following error:

Cloning into 'test.git'...
error: gnutls_handshake() failed: A TLS warning alert has been received. while accessing https://<my server>/test.git/info/refs
fatal: HTTP request failed

Looking for some information I've found this bug on Debian:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=515200

And, looking a bit more, I've found a solution that works for me:

https://code.google.com/p/wfuzz/wiki/PyCurlSSLBug

Is it possible to have a different version of python-pycurl compiled with openssl?

Thanks!

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: python-pycurl 7.19.0-5ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-22.34-generic 3.5.7.2
Uname: Linux 3.5.0-22-generic x86_64
ApportVersion: 2.6.1-0ubuntu10
Architecture: amd64
Date: Thu Jan 31 15:53:40 2013
InstallationDate: Installed on 2012-12-03 (59 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
MarkForUpload: True
SourcePackage: pycurl
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jorge (correajl) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pycurl (Ubuntu):
status: New → Confirmed
Revision history for this message
PabloRQ (pablo-romeroquinteros) wrote :

Hi,

I've tried it in Ubuntu 14.04 64bit AMD, but I've an error. In this case, the pycurl package is python-pycurl_7.19.3-0ubuntu3_amd64.deb

Updated workaround:
1. sudo apt-get install build-essential fakeroot dpkg-dev
2. mkdir ~/python-pycurl-openssl
3. cd ~/python-pycurl-openssl
4. sudo apt-get source python-pycurl
5. sudo apt-get build-dep python-pycurl
6. sudo apt-get install libcurl4-openssl-dev
7. sudo dpkg-source -x pycurl_7.19.3-0ubuntu3.dsc
8. cd pycurl-7.19.3
9. edit debian/control file and replace all instances of “libcurl4-gnutls-dev” with “libcurl4-openssl-dev” (7 changes)
10. sudo dpkg-buildpackage -rfakeroot -b
11. sudo dpkg -i ../python-pycurl_7.19.3-0ubuntu3_amd64.deb

During the step 10 I've got this error:

ERROR

======================================================================
ERROR: test suite for <module 'tests' from '/home/parq/python-pycurl-openssl/pycurl-7.19.3/tests/__init__.py'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/suite.py", line 208, in run
    self.setUp()
  File "/usr/lib/python2.7/dist-packages/nose/suite.py", line 291, in setUp
    self.setupContext(ancestor)
  File "/usr/lib/python2.7/dist-packages/nose/suite.py", line 314, in setupContext
    try_run(context, names)
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 471, in try_run
    return func()
  File "/home/parq/python-pycurl-openssl/pycurl-7.19.3/tests/__init__.py", line 6, in setup_package
    import pycurl
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (gnutls)

----------------------------------------------------------------------
Ran 0 tests in 0.063s

The package is created anyway and can be installed. But when I test it in python (pycurl.version) I got the same error:

Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (gnutls)
>>>

Any idea?

Revision history for this message
Barry Warsaw (barry) wrote :

I can no longer verify this bug with the latest versions of pycurl in Debian (7.19.5-2) built against gnutls28. See the Debian bug for details. I have an Ubuntu version that is awaiting FFe for upload to utopic and it also does not exhibit this problem. If you still see the problem in Utopic after the upload of the new version, please reopen this bug.

Changed in pycurl (Ubuntu):
status: Confirmed → Invalid
Changed in pycurl (Debian):
status: Unknown → New
Changed in pycurl (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.