eclecticNancy
Programmer
I'm trying to access a server using FTP/SSL. I am using ftplib but don't have an ssl library (suggestions?) - In fact, any FTP/SSL help is welcome but my primary question here is more general.
I'm running interactive within PythonWin. I'm able to capture some of the server replies, but I think there are more. (I've been unable to duplicate from command prompt because with Py I know how to send additional commands before USER/PASS but I don't know how to do that from cmd.)
Here's what I've written:
Here's what I see (with my username at xxxxxx):
(I'm using code tags to set it apart but it's the output)
Thanks for any help,
Nancy
I'm running interactive within PythonWin. I'm able to capture some of the server replies, but I think there are more. (I've been unable to duplicate from command prompt because with Py I know how to send additional commands before USER/PASS but I don't know how to do that from cmd.)
Here's what I've written:
Code:
from ftplib import FTP
print 'starting ftp'
m = ftp = FTP()
print m
success = 1
try:
print 'ftp.connect(serverName, portNum)'
m = ftp.connect(serverName, portNum)
print m
except:
print "Couldn't find server"
success = 0
if success:
try:
print "ftp.sendcmd('AUTH SSL')"
m = ftp.sendcmd('AUTH SSL')
print m
except:
print 'failed'
success = 0
if success:
try:
print "ftp.sendcmd('USER ' + userName)"
m = ftp.sendcmd('USER ' + userName)
print m
except:
print 'USER ' + userName
print 'login failed'
success = 0
Here's what I see (with my username at xxxxxx):
(I'm using code tags to set it apart but it's the output)
Code:
starting ftp
<ftplib.FTP instance at 0x0162EA30>
ftp.connect(serverName, portNum)
220-Hello, Welcome to SecureTransport!
220-
220 Secure FTP Server ready.
ftp.sendcmd('AUTH SSL')
334 SSLv23/TLSv1
ftp.sendcmd('USER' + userName)
USER xxxxxx
login failed
Thanks for any help,
Nancy