class_docstr: A session class that allows for the TLS verification mode of a WebSocket connection to be
  configured.
class_docstr_tok: ["A","session","class","that","allows","for","the","TLS","verification","mode","of","a","WebSocket","connection","to","be","configured","."]
code: def __init__(
      self,
      socket: lomond.WebSocket,
      cert_file: Union[str, bool, None],
      cert_name: Optional[str],
  ) -> None:
      super().__init__(socket)
      self.ctx = ssl.create_default_context()
      self.cert_name = cert_name
      if cert_file is False:
          self.ctx.check_hostname = False
          self.ctx.verify_mode = ssl.CERT_NONE
          return
  
      if cert_file is not None:
          assert isinstance(cert_file, str)
          self.ctx.load_verify_locations(cafile=cert_file)
  
imports: from __future__ import annotations
  import contextlib
  import io
  import os
  import socket
  import socketserver
  import ssl
  import sys
  import threading
  import time
  import urllib.request
  from dataclasses import dataclass
  from typing import Iterator, List, Optional, Union
  import lomond
  from determined.common.api import Session, authentication, bindings, request
label_desc: Use image node_id 1 to create a new CustomSSLWebsocketSession object from inherited base classes: lomond.session with example: obj = CustomSSLWebsocketSession(socket, cert_file, cert_name)