8000 add client support for explicit tls by bellini666 · Pull Request #183 · aio-libs/aioftp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add client support for explicit tls #183

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

Merged
merged 16 commits into from
Apr 8, 2025

Conversation

bellini666
Copy link
Contributor

Hi @pohmelie ,

I saw the discussion on #37 and decided to create this PR based on @sammichaels fork.

The only thing I did here was to merge the fork on top of the upstream master branch and adjust the conflicts.

Please let me know what I need to do to get this merged and released and I'll adjust it myself, as I currently need explicit TLS support and the code here seems to make it work.

sammichaels and others added 8 commits November 9, 2023 18:06
…cit TLS.

Added error checking on AUTH TLS command to raise TLSError if the command fails.

Added "sslcontext" parameter to client.upgrade_to_tls() for a custom context when manually upgrading a connection.

Added the "transport" property when checking the stream writer for the SSL object.
# Conflicts:
#	src/aioftp/client.py
@pohmelie
Copy link
Collaborator

Is it a client-only explicit tls support? I see no new commands in server.py

Copy link
codecov bot commented Mar 14, 2025

Codecov Report

Attention: Patch coverage is 76.19048% with 10 lines in your changes missing coverage. Please review.

Project coverage is 98.34%. Comparing base (8c774d8) to head (ebc3540).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/aioftp/common.py 50.00% 9 Missing ⚠️
src/aioftp/client.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #183      +/-   ##
==========================================
- Coverage   98.83%   98.34%   -0.50%     
==========================================
  Files           6        6              
  Lines        1896     1936      +40     
==========================================
+ Hits         1874     1904      +30     
- Misses         22       32      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bellini666
Copy link
Contributor Author

Is it a client-only explicit tls support? I see no new commands in server.py

From what I understood, yep!

It has a new explicit_tls for the client which, when set to True, will do what needs to be done for ftps to work

As I said, I'm not the author of the code, I'm mostly trying to get this merged as it solves the issue for me (without this I can't connect to a server with ftps)

I can adjust anything that needs to be adjusted in the code, and/or write more unit tests if needed! Just let me know :)

Copy link
Collaborator
@pohmelie pohmelie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is what need to be done (if possible):

  • tests: not sure how to test this ssl things actually, since we have no server code)
  • documentation: check if docs are extended with new comments

@pohmelie pohmelie changed the title Support for explicit TLS add client support for explicit tls Mar 22, 2025
@pohmelie
Copy link
Collaborator

There is also mechaninc in ftp to remove tls out from connection, so this pr is less than a 1/4 of what need to be done. But, I think we will merge this anyway after review/changes, since I think no one will implement full support till the universe end

@bellini666
Copy link
Contributor Author

Hi @pohmelie

Thanks for the review

I've done the adjustments you requested, will try to add a couple of tests and docs tomorrow. Let me know if there's any other required adjustment here

@bellini666 bellini666 requested a review from pohmelie April 1, 2025 15:23
@bellini666
Copy link
Contributor Author
bellini666 commented Apr 1, 2025

@pohmelie sorry for not taking a look earlier.

I have made the adjustments you asked, added some tests and some documentation. Let me know if anything else is missing :)

@bellini666
Copy link
Contributor Author

Hi @pohmelie ,

Friendly ping about this PR :)

Waiting on this to be merged and released to be able to use it in a project at work

bellini666 and others added 2 commits April 8, 2025 10:33
Co-authored-by: Nikita Melentev <multisosnooley@gmail.com>
@bellini666 bellini666 requested a review from pohmelie April 8, 2025 08:34
@bellini666
Copy link
Contributor Author

@pohmelie should be all good now! :)

@pohmelie
Copy link
Collaborator
pohmelie commented Apr 8, 2025

@pohmelie should be all good now! :)

Checkout the tests for python 3.9

@bellini666
Copy link
Contributor Author

@pohmelie should be all good now! :)

Checkout the tests for python 3.9

Fixed it. Ended up removing the typing info. Although I like type annotations, this project doesn't make use of them, so no need to have them.

AE96

@pohmelie
Copy link
Collaborator
pohmelie commented Apr 8, 2025

Nah, broken again. Did you run tests localy?

@bellini666
Copy link
Contributor Author

Nah, broken again. Did you run tests localy?

I had before, but not after the typing removal, by bad :(

(the culprit was this: 146aef5 (#183). I removed the =None as well by mistake in a hurry)

Fixed now, ran the tests locally to make sure (but not in every python version supported)

@pohmelie pohmelie merged commit 9f9cb2f into aio-libs:master Apr 8, 2025
8 of 10 checks passed
@pohmelie
Copy link
Collaborator
pohmelie commented Apr 8, 2025

Thank you for the contribution @bellini666

@bellini666
Copy link
Contributor Author

@pohmelie thanks mostly to @sammichaels . I just made sure his work on his fork got here :)

@pohmelie pohmelie mentioned this pull request Sep 13, 2024
2 tasks
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

Successfully merging this pull request may close these issues.

3 participants
0