code: def _shutdown_transport(self):
          
          if self.sock is not None:
              try:
                  unwrap = self.sock.unwrap
              except AttributeError:
                  return
              try:
                  self.sock = unwrap()
              except ValueError:
                  # Failure within SSL might mean unwrap exists but socket is not
                  # deemed wrapped
                  pass
docs: Unwrap a Python 2.6 SSL socket, so we can call shutdown()