Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does aioftp support FTPES (FTP server over explicit TLS/SSL) #93

Closed
saulcruz opened this issue Apr 29, 2019 · 6 comments
Closed

Does aioftp support FTPES (FTP server over explicit TLS/SSL) #93

saulcruz opened this issue Apr 29, 2019 · 6 comments

Comments

@saulcruz
Copy link

saulcruz commented Apr 29, 2019

from ftplib import FTP_TLS

Using ftplib I was able to connect to my FTP server over explicit TLS/SSL in Python, I have not found a way to asynchronously download files using the aioftp library and FTPS. Does it only support plain FTP? If it supports FTPES would you please provide an example?

Update
I noticed that this feature was added #81

Does the same example in the README work? or are there any additional steps to connect to the FTP over explicit TLS/SSL ?

I'm getting the following error:
line 689, in do_handshake
ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:847)

import asyncio
import aioftp


async def get_mp3(host, port, login, password):
    async with aioftp.ClientSession(host, port, login, password, ssl=True) as client:
        for path, info in (await client.list(recursive=True)):
            if info["type"] == "file" and path.suffix == ".mp3":
                await client.download(path)


loop = asyncio.get_event_loop()
tasks = (
    get_mp3("server1.com", 21, "login", "password")),
    get_mp3("server2.com", 21, "login", "password")),
    get_mp3("server3.com", 21, "login", "password")),
)
loop.run_until_complete(asyncio.wait(tasks))
loop.close()

Thanks for this library :)

@pohmelie
Copy link
Collaborator

@saulcruz

Does the same example in the README work?

ssl=True just passed to open_connection. No magic (even no code at all 😄 ) here from aioftp library with ssl. So, yes, it works.

@saulcruz
Copy link
Author

Interesting, not working for me :( not sure what is wrong or different in my server. It works when using fptlib and the FTP_TLS

from ftplib import FTP_TLS
ftps = FTP_TLS('ftp.python.org')
ftps.login() # login anonymously before securing control channel
ftps.prot_p() # switch to secure
ftps.retrlines('LIST')

@rsichnyi
Copy link
Contributor

rsichnyi commented Apr 30, 2019

explicit mode is not implemented, see #37

@pohmelie
Copy link
Collaborator

Oh, my bad. I misread "explicit". Only implicit mode supported right now. @rsichny, thanks!

@saulcruz
Copy link
Author

Thanks @pohmelie and @rsichny will find a workaround then

@saulcruz saulcruz changed the title Does aioftp support FTPES Does aioftp support FTPES (FTP server over explicit TLS/SSL) Apr 30, 2019
@pohmelie
Copy link
Collaborator

Further discussion in #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants