-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add implicit FTPS support #81
Conversation
9c83950
to
8908633
Compare
Codecov Report
@@ Coverage Diff @@
## master #81 +/- ##
==========================================
+ Coverage 94.01% 94.02% +<.01%
==========================================
Files 7 7
Lines 1688 1690 +2
==========================================
+ Hits 1587 1589 +2
Misses 101 101
Continue to review full report at Codecov.
|
Any chance to add a test? |
I thought about tests, but I don't know a good way for testing transport without ssl support at the server part. Can you advise me how to implement it? |
@Alxpy, thanks for pr! This pr is ¼ of what should be implemented for saying «we support ftps». There is two modes: explicit and implicit. And two sides: client and server. You implement implicit client ftps. Also, I'm sceptical about ftps, since it is pretty rare. But, anyway, I see no reasons to not to merge. @asvetlov @Alxpy, is there a chance you will implement implicit server side mode, so we can write tests and have half ftps support? I will wait a day before merge. Maybe someone have strong point to reject this pr or @Alxpy take care of implicit server side support. |
You are right, mocked tests are useless for this case |
@pohmelie thanks for the detailed answer! I will try to implement implicit server side ftps. |
lgtm (server side is useless, imo) |
8908633
to
7a4d9f6
Compare
7a4d9f6
to
a3f13b7
Compare
Implicit server side FTPS added. |
I can't generate certificate which can work with Python 3.7 =( |
2ac57b2
to
e3b5138
Compare
@Alxpy try generating test certs via |
Why? Did you set up the hostname correctly? |
await client.connect("127.0.0.1", PORT) | ||
await client.login() | ||
await client.download( | ||
_client = aioftp.Client(loop=loop, ssl=client.ssl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no point/value in underscoring bunch of vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so how would you like to call a variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep it as is, I didn't realize that it's an "extended boolean"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that was not about ssl
ssl_context = ...
...
...
ca = trustme.CA()
ca.issue_server_cert(u'127.0.0.1')
ca.configure_trust(ssl_context) |
Yes, I use hostname correctly. And any tests work, but not all. |
oh, that's easy |
ssl_context = ...
...
...
ca = trustme.CA()
ca.issue_server_cert(u'127.0.0.1', u'::1', u'localhost') # list all incarnations of localhost
ca.configure_trust(ssl_context) Ref: https://trustme.readthedocs.io/en/latest/#trustme.CA.issue_server_cert |
e3b5138
to
267db49
Compare
|
await client.connect("127.0.0.1", PORT) | ||
await client.login() | ||
await client.download( | ||
_client = aioftp.Client(loop=loop, ssl=client.ssl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo underscoring of client
var. It's not related, nor needed.
@pohmelie FTPS seems to be just plain old FTP on top of TLS, nothing more. So stick SSL between TCP and the app and you're done. Simple and elegant. @Alxpy I insist that wholesale renaming of |
@webknjaz |
@webknjaz you can try rename |
@Alxpy so tell me: what is that? |
Oh, I see. You're messing with scopes... |
@Alxpy Thank you for great contribution! 🎉 |
SSL support added.
#37