cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTPS POST problem (resent as subscriber)

From: Mark Philip Erikson <s1278644_at_cedarville.edu>
Date: Sat, 12 Apr 2003 16:31:23 -0400

Hi, folks. I'm running into a bit of an issue trying to use PyCurl to
execute an HTTPS post. I've got OpenSSL installed, and the initial
connection seems to go fine, but partway through it breaks.

Quick bit of background first, for what it's worth. Our school uses
Novell Bordermanager as a proxy server, and non-school computers have to
log into the proxy through a web page. This page is brought up on the
initial request when not logged in, and since a half-hour of inactivity
logs the user out, it gets annoying having to log back in all the time.

After poking around at the login page, I can load up into a browser a
page of my own creation with the same form names and the POST directed
at the login server, fill it in, submit, and it works. So,
theoretically, all I should have to do is programmitically put together
an SSL-encrypted POST to the server, and I'm logged in.

Here's where the problem comes in. Using the debug stuff, I can see
that the SSL connection works and the POST begins. Several headers get
sent. Then, it dies. Here's the relevant part of the debug section:

debug(2): POST /BM-Login/auth-cup HTTP/1.1
Host: *proxy server IP*
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 110
Content-Type: application/x-www-form-urlencoded

debug(0): SSL read error: 5

debug(0): Connection #0 left intact

Traceback (most recent call last):
  File "F:\Projects\proxy\curl.py", line 22, in ?
    c.perform()
pycurl.error: (56, 'SSL read error: 5')

And here's the code that produced it

import pycurl
import os

def test(debug_type, debug_msg):
        print "debug(%d): %s" % (debug_type, debug_msg)
        
c = pycurl.Curl()

params = # bunch of fields from the form, encoded

c.setopt(pycurl.SSLVERSION, 3)
c.setopt(pycurl.URL, ' *server URL* ')
c.setopt(pycurl.POSTFIELDS, params)
c.setopt(pycurl.SSL_VERIFYPEER, 0)
c.setopt(pycurl.VERBOSE, 1)
c.setopt(pycurl.DEBUGFUNCTION, test)

c.perform()

So... any ideas what this "SSL read error" is? I can't tell whether
it's a problem with OpenSSL or Curl, but I figured it was worth checking
here.

Thanks in advance for any help!

Mark Erikson

-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
Received on 2003-04-12