Skip to content

Support for TLS server_mode#5

Open
arcriley wants to merge 2 commits intohorazont:develfrom
arcriley:devel
Open

Support for TLS server_mode#5
arcriley wants to merge 2 commits intohorazont:develfrom
arcriley:devel

Conversation

@arcriley
Copy link

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 45.255% when pulling 0d49975 on arcriley:devel into 41796f4 on horazont:devel.


# Drain before initializing TLS
while self._buffer:
yield from asyncio.sleep(0)
Copy link
Owner

Choose a reason for hiding this comment

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

I haven’t looked at this into detail yet, so this may be stupid, but yield from self.drain() is no option?

Also, this makes concurrent writes undefined, which should at least be documented.

In addition, a very simple server-mode test (possibly without starttls) should be added. I’m trying to get some unit-test coverage into aioopenssl.

@arcriley
Copy link
Author

arcriley commented May 27, 2017 via email

@horazont
Copy link
Owner

Ah, I assumed that drain was provided by the base class somehow; which of course doesn’t make sense because the base class doesn’t do any buffer management.

I’ll have a look at this this weekend.

@horazont
Copy link
Owner

I tried to write tests for this, and I’m not entirely convinced of the design yet. How is that supposed to be used?

One cannot meaningfully use server_mode with host and port, so sock is the only option. However, with BaseEventLoop.create_server, one cannot replace the transport; instead, one has to provide a Protocol (one could of course create a "Protocol" which .

So the create_starttls_connection function is not really useful for this kind of scenario.

I really would like to avoid to re-create the create_server logic of asyncio. We might need a completely different approach, possibly layering the STARTTLS layer as a Protocol which also exposes a Transport interface.

Thoughts?

@arcriley
Copy link
Author

arcriley commented May 30, 2017 via email

@horazont
Copy link
Owner

Okay, in that case, that starttls_server function should probably be included in aioopenssl (even though I don’t like it). It should also use the STARTTLSTransport constructor directly then, which should be extended by an argument which allows to initialise the extra-dict.

@arcriley
Copy link
Author

arcriley commented May 30, 2017 via email

@horazont
Copy link
Owner

Hey ho! It’s been a while! Do you have any intention on persuing this or can we close it?

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