code: def _get_ssl_sock(self):
          
          assert self.scheme == u"https", self
          raw_connection = self.url_connection.raw._connection
          if raw_connection.sock is None:
              # sometimes the socket is not yet connected
              # see https://github.com/kennethreitz/requests/issues/1966
              raw_connection.connect()
          return raw_connection.sock
docs: Get raw SSL socket.