[python-tulip] TLS/SSL Wrapping

2014-04-05 Thread Imran Geriskovan
Hi,
Normal sockets can be created, used for some communications and then they may be
wrapped with a SSLContext to proceed in encrypted mode.

How can such a sequence be executed using asynio?
Mode of communication is determined at creation time (ie. when calling
'open_connection').
Is there any way to switch to TLS/SSL after that?

Regards,
Imran


Re: [python-tulip] TLS/SSL Wrapping

2014-04-05 Thread Alex Gaynor
SMTP code with smtplib which use `.startls()` are an example of this:
http://hg.python.org/cpython/file/default/Lib/smtplib.py#l641

Alex


On Sat, Apr 5, 2014 at 2:54 PM, Guido van Rossum gu...@python.org wrote:

 We would like to support that, but we didn't have the expertise or time to
 implement it yet. Do you want to help? Can you show a working piece of code
 that does this with synchnonous sockets? Maybe I could translate that into
 asyncio code.


 On Saturday, April 5, 2014, Imran Geriskovan imran.gerisko...@gmail.com
 wrote:

 Hi,
 Normal sockets can be created, used for some communications and then they
 may be
 wrapped with a SSLContext to proceed in encrypted mode.

 How can such a sequence be executed using asynio?
 Mode of communication is determined at creation time (ie. when calling
 'open_connection').
 Is there any way to switch to TLS/SSL after that?

 Regards,
 Imran



 --
 --Guido van Rossum (on iPad)




-- 
I disapprove of what you say, but I will defend to the death your right to
say it. -- Evelyn Beatrice Hall (summarizing Voltaire)
The people's good is the highest law. -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084


[python-tulip] Re: TLS/SSL Wrapping

2014-04-05 Thread Antoine Pitrou
On Sat, 5 Apr 2014 15:25:04 -0700
Guido van Rossum gu...@python.org wrote:
 Thanks! It may be as simple as instantiating this class with the right
 args:
 https://code.google.com/p/tulip/source/browse/asyncio/selector_events.py#545
 
 It looks like we should make a new protocol object though.

I think you want to handle that within the existing protocol object.

Regards

Antoine.