Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8305205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:02:29+00:00 2026-06-08T18:02:29+00:00

While trying pycurl for some url def call_soap_curl(ncServerURL, xml, action): c = pycurl.Curl() c.setopt(pycurl.URL,

  • 0

While trying pycurl for some url

 def call_soap_curl(ncServerURL, xml, action):

  c = pycurl.Curl()
  c.setopt(pycurl.URL, ncServerURL)
  c.setopt(pycurl.POST, 1)
  c.setopt(pycurl.SSL_VERIFYPEER, 0)
  c.setopt(pycurl.SSL_VERIFYHOST, 0)
  header=["Content-type: text/xml","SOAPAction:"+action,'Content-Type: text/xml; charset=utf-8','Content-Length: '+str(len(xml))]
  print header
  c.setopt(pycurl.HTTPHEADER, header)
  c.setopt(pycurl.POSTFIELDS, str(xml))
  import StringIO
  b = StringIO.StringIO()
  c.setopt(pycurl.WRITEFUNCTION, b.write)
  c.perform()
  ncServerData = b.getvalue()
  return ncServerData

The error m getting is

(56, 'GnuTLS recv error (-9): A TLS packet with unexpected length was received.')
  @c.perform()

Please suggest what can be problem , how can i solve this.
Using Ubuntu and same url in curl in php working

This is my

 pycurl.version_info()
(3, '7.21.6', 464134, 'x86_64-pc-linux-gnu', 17981, 'GnuTLS/2.10.5', 0, '1.2.3.4', ('dict', 'file', 'ftp', 'ftps', 'gopher', 'http', 'https', 'imap', 'imaps', 'ldap', 'pop3', 'pop3s', 'rtmp', 'rtsp', 'smtp', 'smtps', 'telnet', 'tftp'), None, 0, '1.22')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:02:31+00:00Added an answer on June 8, 2026 at 6:02 pm

    This seems to be a problem with libcurl compiled with GnuTLS.

    Elsewhere I read:

    https://bugs.launchpad.net/gwibber/+bug/626023/comments/28 was also
    suggested, “The only way i managed to get rid of that error, was by
    recompiling libcurl with OpenSSL instead of GnuTLS and then
    recompiling python-pycurl against the new cURL library

    I recompiled libcurl with OpenSSL as suggested and the problem was solved for me. I’ve included my recipe here for inspiration, though it’s Ubuntu specific.

    #!/bin/bash
    
    sudo apt-get install libcurl4-openssl-dev
    
    wget http://curl.haxx.se/download/curl-7.26.0.tar.gz
    wget http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
    tar -xzvf pycurl-7.19.0.tar.gz
    tar -xzvf curl-7.26.0.tar.gz
    cd curl-7.26.0/
    ./configure --with-ssl
    make
    sudo make install
    cd ../pycurl-7.19.0/
    sudo python setup.py install
    
    sudo ldconfig
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing this to fetch some data: c = pycurl.Curl() c.setopt(pycurl.ENCODING, 'gzip') c.setopt(pycurl.URL, url)
While trying to send a POST request via xmlhttp.open(POST, url, true) (javascript) to the
while trying to deploy a Grails application into tomcat6 I ran into some problems:
While trying to streamline my init.el, I decided to move some functionality out of
While trying to retrieve the URL http://www.kat.ph/search/snow-patrol-shut-your-eyes/?categories%5B%5D=music using curl I am getting an error
while trying to process some user input which contains characters such as <. I
While trying a sem-complex query to display some ListView content on the page I
While trying to implement some jQuery UI Tabs using AJAX I keep running into
While trying to compile some code out of .txt files (at run time), I
While trying to resolve some debugging issues , I added some printf -s to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.