/* Creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections. */
VOID* EFIAPI TlsCtxNew(IN UINT8 MajorVer, IN UINT8 MinorVer)
/* Creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections. */
VOID* EFIAPI TlsCtxNew(IN UINT8 MajorVer, IN UINT8 MinorVer)
{
  SSL_CTX  *TlsCtx;
  UINT16   ProtoVersion;
  ProtoVersion = (MajorVer << 8) | MinorVer;
  TlsCtx = SSL_CTX_new (SSLv23_client_method ());
  if (TlsCtx == NULL) {
    return NULL;
  }
  SSL_CTX_set_options (TlsCtx, SSL_OP_NO_SSLv3);
  SSL_CTX_set_min_proto_version (TlsCtx, ProtoVersion);
  return (VOID *)TlsCtx;
}