parameters: (self, transport, protocol, sslcontext, *,
                          server_side=False,
                          server_hostname=None,
                          ssl_handshake_timeout=None)
return_statement: return ssl_protocol._app_transport
docstring: Upgrade transport to TLS.
  
          Return a new transport that *protocol* should start using
          immediately.
docstring_summary: Upgrade transport to TLS.
docstring_tokens: Upgrade transport to TLS .
function: async def start_tls(self, transport, protocol, sslcontext, *,
                          server_side=False,
                          server_hostname=None,
                          ssl_handshake_timeout=None):
          """Upgrade transport to TLS.
  
          Return a new transport that *protocol* should start using
          immediately.
          """
          if ssl is None:
              raise RuntimeError('Python ssl module is not available')
  
          if not isinstance(sslcontext, ssl.SSLContext):
              raise TypeError(
                  f'sslcontext is expected to be an instance of ssl.SSLContext, '
                  f'got {sslcontext!r}')
  
          if not getattr(transport, '_start_tls_compatible', False):
              raise TypeError(
                  f'transport {transport!r} is not supported by start_tls()')
  
          waiter = self.create_future()
          ssl_protocol = sslproto.SSLProtocol(
              self, protocol, sslcontext, waiter,
              server_side, server_hostname,
              ssl_handshake_timeout=ssl_handshake_timeout,
              call_connection_made=False)
  
          # Pause early so that "ssl_protocol.data_received()" doesn't
          # have a chance to get called before "ssl_protocol.connection_made()".
          transport.pause_reading()
  
          transport.set_protocol(ssl_protocol)
          conmade_cb = self.call_soon(ssl_protocol.connection_made, transport)
          resume_cb = self.call_soon(transport.resume_reading)
  
          try:
              await waiter
          except Exception:
              transport.close()
              conmade_cb.cancel()
              resume_cb.cancel()
              raise
  
          return ssl_protocol._app_transport
function_tokens: async def start_tls ( self , transport , protocol , sslcontext , * , server_side = False , server_hostname = None , ssl_handshake_timeout = None ) : if ssl is None : raise RuntimeError ( 'Python ssl module is not available' ) if not isinstance ( sslcontext , ssl . SSLContext ) : raise TypeError ( f'sslcontext is expected to be an instance of ssl.SSLContext, ' f'got {sslcontext!r}' ) if not getattr ( transport , '_start_tls_compatible' , False ) : raise TypeError ( f'transport {transport!r} is not supported by start_tls()' ) waiter = self . create_future ( ) ssl_protocol = sslproto . SSLProtocol ( self , protocol , sslcontext , waiter , server_side , server_hostname , ssl_handshake_timeout = ssl_handshake_timeout , call_connection_made = False ) # Pause early so that "ssl_protocol.data_received()" doesn't # have a chance to get called before "ssl_protocol.connection_made()". transport . pause_reading ( ) transport . set_protocol ( ssl_protocol ) conmade_cb = self . call_soon ( ssl_protocol . connection_made , transport ) resume_cb = self . call_soon ( transport . resume_reading ) try : await waiter except Exception : transport . close ( ) conmade_cb . cancel ( ) resume_cb . cancel ( ) raise return ssl_protocol . _app_transport