473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FTPS ( FTP over SSL) Problem with Python's builtin SSL

I need to run FTP over SSL from windows (not shitty sftp via ssh etc!)
as explained on
http://www.ford-hutchinson.com/~fh-1-pfh/ftps-ext.html (good variant
3: FTP_TLS )

I tried to learn from M2Crypto's ftpslib.py (uses OpenSSL - not
Pythons SSL) and made a wrapper for ftplib.FTP using Pythons SSL.

I wrap the cmd socket like:

self.voidcmd('A UTH TLS')
ssl = socket.ssl(self .sock, self.key_file, self.cert_file)
import httplib
self.sock = httplib.FakeSoc ket(self.sock, ssl)
self.file = self.sock.makef ile('rb')

Everything works ok, if I don't SSL the data port connection, but only
the
If I SSL the data port connection too, it almosts work, but ...

self.voidcmd('P BSZ 0')
self.voidcmd('P ROT P')

wrap the data connection with SSL:

ssl = socket.ssl(conn , self.key_file, self.cert_file)
import httplib
conn = httplib.FakeSoc ket(conn, ssl)

than in retrbinary it hangs endless in the last 'return
self.voidresp() '. all data of the retrieved file is already correctly
in my basket! The ftp server just won't send the final '226 Transfer
complete.' on the cmd socket. Why?

def retrbinary(self , cmd, callback, blocksize=8192, rest=None):
self.voidcmd('T YPE I')
conn = self.transfercm d(cmd, rest)
fp = conn.makefile(' rb')
while 1:
#data = conn.recv(block size)
data = fp.read() #blocksize)
if not data:
break
callback(data)
fp.close()
conn.close()
return self.voidresp()
what could be reason?
The server is a ProFTPD 1.2.9 Server.
I debugged, that the underlying (Shared)socket of the conn object is
really closed.
(If I simly omit the self.voidresp() , I have one file in the box, but
subsequent ftp communication on that connection is not anymore
correct.)

Someone else has already made this FTP over Python's SSL?

Robert
Jul 18 '05 #1
1 4606
On 4 Jun 2004 15:15:10 -0700, k.******@gmx.de (Robert) wrote:
I need to run FTP over SSL from windows (not shitty sftp via ssh etc!)
as explained on
http://www.ford-hutchinson.com/~fh-1-pfh/ftps-ext.html (good variant
3: FTP_TLS )

I'm curious. How is sftp bad for you?
<{{{*>


Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2593
by: Derek | last post by:
what usually causes a java.security.NoSuchAlgorithmException? i am getting this while trying to run WebTest with SSL. so, if there is anyone out there using SSL and webtest i would appreciate the help on the problem listed below. Thanks. --- I read the introduction on maven-plugins page...
0
2297
by: Miroslav Milosevic via .NET 247 | last post by:
I have mfc-based windows application which consumes a web service. I implemented ATL-based secure SOAP communication as per Microsoft's SecureSOAP Sample, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/vcsamSecureSOAPSample.asp as following: typedef CSoapSocketClientT<CSecureEvtSyncSocket>...
1
2337
by: Sean Wolfe | last post by:
I have this wierd bizarrre problem that I'm experienceing with the Response.Redirect() method. I have a site where the users are on a particular page in SSL. When they post the data back, and the processing is done, it then tries to redirect them back to the non-SSL site. But the site is on a non-starndard port number. I place in the...
5
2697
by: Dany C. | last post by:
We have install a valid SSL certificate issued to www.mycompany.com on our web server running IIS 6.0 / win2003 SP1. Then we have created a sub domain pointing to the same server for our web services at ws.mycompany.com. We have properly installed the server certificate on the client machine. When the client try to connect to our secure...
4
2447
by: Chris Curvey | last post by:
I need to use socket.ssl() to open a connection using key files. I have been provided with a text file called cert_key_pem.txt containing my keys that looks like this: -----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQDKwLuk/UpICOnZvH3mf9rFQvCkDPA8XQZLpa80Z0liMVYu4GQT <snip> -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE-----...
0
1400
by: batista | last post by:
Hello all, I am using a webpage having a grid and im calling a webservice method(using webservice.htc) which after 5 seconds updates the content of the grid, uptil now everything is working fine. But now I want to use it with https so now what should i Do.. I actually have many confusions regarding this issue...
0
900
by: Ingo Beyer | last post by:
hi all, for an update task i need to establish a http-SSL-connection to a updateserver. therefore i will use an application on the client. the client-update-app should use a special client ssl-certificate, so that only clients with this certificate can communicate to the server. how can i do this? how can i establish a HTTPWebRequest (or...
0
1279
by: Gareth | last post by:
I am trying to use a web service from VC++. I want to use SSL and basic authentication. I can get basic authentication to work with out SSL. I have used the CSecureEvtSyncSocket class from the http://msdn.microsoft.com/library/en-us/vcsample/html/vcsamSecureSOAP... sample but it fails to compile when I add the auth method to the socket with...
7
1605
by: c_shah | last post by:
I have an asp.net website (IIS 6 on windows Server 2003, .NET Framework 2.0) On one of my page I am making a call to a ASP.net web service (to obtain some data), I DO NOT want to make any secure calls to the web service. Does SSL have any issue with consuming a web service inside your asp.net web page?
0
1751
by: nukawa | last post by:
Hi guys: I have a problem about SSL with apache2 on solaris10 operation system. The enviorment is below: 1) I install apache2 server with SSL module on the solaris10. 2) I write program which using JSSE to establish the apache server. 3) I change the configuration of SSL which only support SSLv3. 4) I change my program code to use...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.