這裏是我的問題的答案。在python中有一個名爲chilkat的模塊,我可以登錄到隱式ftps服務器。
import sys
import chilkat
ftp = chilkat.CkFtp2()
# Any string unlocks the component for the 1st 30-days.
success = ftp.UnlockComponent("Anything for 30-day trial")
if (success != True):
print(ftp.lastErrorText())
sys.exit()
# If this example does not work, try using passive mode
# by setting this to True.
ftp.put_Passive(False)
ftp.put_Hostname("ur host ip")
ftp.put_Username("usename")
ftp.put_Password("passowrd")
ftp.put_Port(990)
# We don't want AUTH SSL:
ftp.put_AuthTls(False)
# We want Implicit SSL:
ftp.put_Ssl(True)
# Connect and login to the FTP server.
success = ftp.Connect()
if (success != True):
print(ftp.lastErrorText())
sys.exit()
else:
# LastErrorText contains information even when
# successful. This allows you to visually verify
# that the secure connection actually occurred.
print(ftp.lastErrorText())
print("FTPS Channel Established!")
# Do whatever you're doing to do ...
# upload files, download files, etc...
localFilename = "c:/temp/hamlet.xml"
remoteFilename = "hamlet.xml"#the file name which u download from the ftps
# Download a file.
success = ftp.GetFile(remoteFilename,localFilename)
if (success != True):
print(ftp.lastErrorText())
ftp.Disconnect()