code: def get_ssl_params(
      server_params: dict,
      https: Optional[bool],
      ssl_key: Optional[str],
      ssl_cert: Optional[str],
  ) -> SSLConfig:
      https = https or server_params["https"]
      if https:
          ssh_key_path = Path(
              ssl_key or server_params["https_key_path"]
          ).resolve()
          if not ssh_key_path.is_file():
              e = FileNotFoundError(
                  "Ssh key file not found: please provide correct path in --key param or "
                  "https_key_path param in server configuration file"
              )
              log.error(e)
              raise e
  
          ssh_cert_path = Path(
              ssl_cert or server_params["https_cert_path"]
          ).resolve()
          if not ssh_cert_path.is_file():
              e = FileNotFoundError(
                  "Ssh certificate file not found: please provide correct path in --cert param or "
                  "https_cert_path param in server configuration file"
              )
              log.error(e)
              raise e
  
          ssl_config = SSLConfig(
              version=PROTOCOL_TLSv1_2,
              keyfile=str(ssh_key_path),
              certfile=str(ssh_cert_path),
          )
      else:
          ssl_config = SSLConfig(None, None, None)
  
      return ssl_config
  
imports: import asyncio
  import os
  from collections import namedtuple
  from logging import getLogger
  from pathlib import Path
  from ssl import PROTOCOL_TLSv1_2
  from typing import Dict, List, Optional, Union
  import uvicorn
  from fastapi import Body, FastAPI, HTTPException
  from fastapi.utils import generate_operation_id_for_path
  from pydantic import BaseConfig, BaseModel
  from pydantic.fields import Field, ModelField
  from pydantic.main import ModelMetaclass
  from starlette.middleware.cors import CORSMiddleware
  from starlette.responses import RedirectResponse
  from deeppavlov.core.commands.infer import build_model
  from deeppavlov.core.commands.utils import parse_config
  from deeppavlov.core.common.chainer import Chainer
  from deeppavlov.core.common.file import read_json
  from deeppavlov.core.common.log import log_config
  from deeppavlov.core.common.paths import get_settings_path
  from deeppavlov.core.data.utils import check_nested_dict_keys, jsonify_data
  from deeppavlov.utils.connector import DialogLogger
  from deeppavlov.utils.server.metrics import metrics, PrometheusMiddleware
label_desc: Use image node_id 2 for calling a global function with example usage: get_ssl_params(server_params, https, ssl_key, ssl_cert) and returns: ssl_config