curl-and-python

Resolve host problem with proxy and SSL

From: samg samg <samg_pub_at_yahoo.fr>
Date: Tue, 22 Mar 2005 14:57:42 +0100 (CET)

Hello everybody,

This little program has some problems ...
_______________________________________________
import pycurl

def debug(t, b):
        if t<3:
                print "debug(%d): %s" % (t, b)
    
def body(buf):
    pass

c = pycurl.Curl()
c.setopt(pycurl.URL, 'http://XXXXX')
c.setopt(pycurl.VERBOSE, 1)
c.setopt(pycurl.WRITEFUNCTION, body)
c.setopt(pycurl.DEBUGFUNCTION, debug)
c.perform()
c.close()
_______________________________________________

I made my tests with 2 pyCurl versions :
        - pycurl-ssl-7.13.0.win32-py2.4.exe : libcurl/7.13.0
OpenSSL/0.9.7e zlib/1.2.2 c-ares/1.2.1 libidn/0.5.13
        - pycurl-7.13.0.win32-py2.4.exe :libcurl/7.13.0

With the 2 versions of pyCurl, all is ok when i try to
get a page from an intranet site :
debug(0): About to connect() to XXXXX port 80
debug(0): Trying x.x.x.x...
debug(0): connected
debug(0): Connected to XXXXX (x.x.x.x) port 80
debug(2): GET / HTTP/1.1
debug(1): HTTP/1.1 200 OK

When i get a page from an internet site by a proxy,
it's ok with the No-SSL version :
debug(0): About to connect() to proxy port 8080
debug(0): Trying x.x.x.x...
debug(0): connected
debug(0): Connected to proxy (x.x.x.x) port 8080
debug(0): Proxy auth using Basic with user 'XXXXX'
debug(2): GET
http://www.python.org/pics/PyBanner049.gif HTTP/1.1
debug(1): HTTP/1.1 200 OK

But with the SSL version :
debug(0): Could not resolve host: www.python.org
(Domain name not found)
debug(0): Closing connection #0

What's the problem ? (I suspect c-ares)

For information, the OS is windows 2000 and I have no
problem with the curl program (with or without SSL)

Regards

        

        
                
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
_______________________________________________
http://cool.haxx.se/mailman/listinfo/curl-and-python
Received on 2005-03-22