curl-and-python
Connection Problems with FTPS
Date: Wed, 11 May 2005 08:45:16 -0400
Greetings,
I am trying to write a simple python program that will allow me to
upload a file via FTPS to a FTP server. I keep getting, however, this
error:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
The thing is, we get the same error when using the cURL tool. Any ideas
as to what might be happening with this? My python program looks
something like this:
import os, sys
import curl
import pycurl
c = pycurl.Curl()
userpass = 'username:password'
file = 'testfile.txt'
last = ['RNFR (nil)','RNTO testfile.txt']
auth = ['AUTH SSL']
c.setopt(pycurl.FTP_SSL, pycurl.FTPSSL_ALL)
c.setopt(pycurl.FTPSSLAUTH, pycurl.FTPAUTH_DEFAULT)
c.setopt(pycurl.SSL_VERIFYPEER, 1)
c.setopt(pycurl.URL, 'ftps://ftp.myftpssite.com/testfile.txt')
c.setopt(pycurl.PREQUOTE, auth)
c.setopt(pycurl.USERPWD, userpass)
c.setopt(pycurl.UPLOAD, 1)
c.setopt(pycurl.POSTQUOTE, last)
c.setopt(pycurl.READFUNCTION, open(file).read)
filesize = os.path.getsize(file)
c.setopt(pycurl.INFILESIZE, filesize)
print 'Uploading file %s to url' % (file)
c.perform()
c.close()
Thanks for your help!
Jonathan
_______________________________________________
http://cool.haxx.se/mailman/listinfo/curl-and-python
Received on 2005-05-11