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

tlslite with tornado #381

Open
hamdell opened this issue Dec 12, 2019 · 8 comments
Open

tlslite with tornado #381

hamdell opened this issue Dec 12, 2019 · 8 comments
Labels
enhancement new feature to be implemented help wanted

Comments

@hamdell
Copy link

hamdell commented Dec 12, 2019

Hi,I want to wirte httpserver,can tlslite with torado?

@tomato42
Copy link
Member

I'm not familiar with torado, and don't see anything in the code referencing it, so I'd say that the answer as of now is "no".

That being said, it shouldn't be too hard, there already are integrations with few other modules, see the tlslite/integration directory, e.g.: https://github.com/tomato42/tlslite-ng/blob/master/tlslite/integration/httptlsconnection.py

@tomato42 tomato42 added enhancement new feature to be implemented help wanted labels Dec 12, 2019
@hamdell
Copy link
Author

hamdell commented Dec 13, 2019

@tomato42 ,Thank you for your reply. That's not what I want. I want a highly concurrent and asynchronous HTTP server to get SSL clienthello sent by the browser and respond to the browser in the form of HTTP-JSON. Can you write it?

@tomato42
Copy link
Member

I want a highly concurrent and asynchronous [...] server

while this library does support asynchronous operation, it's definitely not fast

HTTP server to [...] respond to the browser in the form of HTTP-JSON

once you establish a TLS connection you can exchange anything you want on top of it...

Can you write it?

no, that's not why I'm working on this library

@tomato42 tomato42 added this to the someday/future milestone Dec 13, 2019
@hamdell
Copy link
Author

hamdell commented Dec 13, 2019

@tomato42 ,thanks,a highly concurrent httpserver to get SSL clienthello sent by the browser is very important to me,the sooner the better,i hope it!

@hamdell
Copy link
Author

hamdell commented Dec 13, 2019

@tomato42 ,I'm very sorry. I misspelled it. It's tornado, a python's high concurrency asynchronous web framework. I saw / scripts / tls.py. So, can tornado replace basehttpserver?

@tomato42
Copy link
Member

So, can tornado replace basehttpserver?

I'd be surprised if it couldn't. If somebody proposes necessary changes to integrate tlslite-ng with tornado, I will review them, but I won't work on them myself.

@hamdell
Copy link
Author

hamdell commented Dec 14, 2019

@tomato42 ,Yes,thank you for your reply. Do you have time to call tornado to write an httpserver script similar to tls.py as soon as possible? It's very important to me, thank you very much!

@HMaker
Copy link

HMaker commented Feb 2, 2022

All good async frameworks integrates well with standard python SSL APIs, one way to integrate is to reimplement the SSL APIs tornado uses using TLSLite as base.

Another way to integrate is through non-blocking sockets, TLSLite supports it, its async functions (named with async suffix) are generators which yields 0 when it wants a readable socket and 1 for writable socket, most async event loops has low level APIs which allows you to set callbacks for when sockets become readable or writable, use it to resume TLSLite generators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new feature to be implemented help wanted
Projects
None yet
Development

No branches or pull requests

3 participants