code: def to_tls(self) -> Self:
      if self.protocol == "https":
          return self
  
      # TODO: only ignore ssl in dev mode
      r = requests.get(  # nosec
          self.base_url, verify=verify_tls()
      )  # ignore ssl cert if its fake
      new_base_url = r.url
      if new_base_url.endswith("/"):
          new_base_url = new_base_url[0:-1]
      return self.__class__.from_url(
          url=f"{new_base_url}{self.path}{self.query_string}"
      )
  
imports: from __future__ import annotations
  import copy
  import os
  import re
  from typing import Optional
  from typing import Union
  from urllib.parse import urlparse
  import requests
  from typing_extensions import Self
  from ..serde.serializable import serializable
  from ..util.util import verify_tls
label_desc: Use image node_id 11 for calling the GridURL obj's underlying member method code with example usage: obj.to_tls() and returns: self, self