# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: xcapi/xray/transport/internet/tls/config.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
from typing import Optional, List
from xcapi.model import ClassMeta
from dataclasses import dataclass
from enum import Enum


@dataclass
class Certificate(ClassMeta):
    certificate: Optional[bytes] = None
    """TLS certificate in x509 format."""
    key: Optional[bytes] = None
    """TLS key in x509 format."""

    class Usage(Enum):
        ENCIPHERMENT: int = 0
        AUTHORITY_VERIFY: int = 1
        AUTHORITY_ISSUE: int = 2

    usage: Optional[Usage] = None
    ocsp_stapling: Optional[int] = None
    certificate_path: Optional[str] = None
    """TLS certificate path"""
    key_path: Optional[str] = None
    """TLS Key path"""
    One_time_loading: Optional[bool] = None
    """If true, one-Time Loading"""
    build_chain: Optional[bool] = None


@dataclass
class Config(ClassMeta):
    allow_insecure: Optional[bool] = None
    """Whether or not to allow self-signed certificates."""
    certificate: Optional[List[Certificate]] = None
    """List of certificates to be served on server."""
    server_name: Optional[str] = None
    """Override server name."""
    next_protocol: Optional[List[str]] = None
    """Lists of string as ALPN values."""
    enable_session_resumption: Optional[bool] = None
    """Whether or not to enable session (ticket) resumption."""
    disable_system_root: Optional[bool] = None
    """If true, root certificates on the system will not be loaded for verification"""
    min_version: Optional[str] = None
    """The minimum TLS version."""
    max_version: Optional[str] = None
    """The maximum TLS version."""
    cipher_suites: Optional[str] = None
    """Specify cipher suites, except for TLS 1.3."""
    fingerprint: Optional[str] = None
    """TLS Client Hello fingerprint (uTLS)."""
    reject_unknown_sni: Optional[bool] = None
    pinned_peer_certificate_chain_sha256: Optional[List[bytes]] = None
    """
    A pinned certificate chain sha256 hash.
    If the server's hash does not match this value, the connection will be aborted.
    This value replace allow_insecure.
    """
    pinned_peer_certificate_public_key_sha256: Optional[List[bytes]] = None
    """
    A pinned certificate public key sha256 hash.
    If the server's public key hash does not match this value, the connection will be aborted.
    This value replace allow_insecure.
    """
    master_key_log: Optional[str] = None


_sym_db = _symbol_database.Default()

DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
    b'\n.xcapi/xray/transport/internet/tls/config.proto\x12\x1bxray.transport.internet.tls\"\xa6\x02\n\x0b\x43\x65rtificate\x12\x13\n\x0b\x63\x65rtificate\x18\x01 \x01(\x0c\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12=\n\x05usage\x18\x03 \x01(\x0e\x32..xray.transport.internet.tls.Certificate.Usage\x12\x15\n\rocsp_stapling\x18\x04 \x01(\x04\x12\x18\n\x10\x63\x65rtificate_path\x18\x05 \x01(\t\x12\x10\n\x08key_path\x18\x06 \x01(\t\x12\x18\n\x10One_time_loading\x18\x07 \x01(\x08\x12\x13\n\x0b\x62uild_chain\x18\x08 \x01(\x08\"D\n\x05Usage\x12\x10\n\x0c\x45NCIPHERMENT\x10\x00\x12\x14\n\x10\x41UTHORITY_VERIFY\x10\x01\x12\x13\n\x0f\x41UTHORITY_ISSUE\x10\x02\"\xb6\x03\n\x06\x43onfig\x12\x16\n\x0e\x61llow_insecure\x18\x01 \x01(\x08\x12=\n\x0b\x63\x65rtificate\x18\x02 \x03(\x0b\x32(.xray.transport.internet.tls.Certificate\x12\x13\n\x0bserver_name\x18\x03 \x01(\t\x12\x15\n\rnext_protocol\x18\x04 \x03(\t\x12!\n\x19\x65nable_session_resumption\x18\x05 \x01(\x08\x12\x1b\n\x13\x64isable_system_root\x18\x06 \x01(\x08\x12\x13\n\x0bmin_version\x18\x07 \x01(\t\x12\x13\n\x0bmax_version\x18\x08 \x01(\t\x12\x15\n\rcipher_suites\x18\t \x01(\t\x12\x13\n\x0b\x66ingerprint\x18\x0b \x01(\t\x12\x1a\n\x12reject_unknown_sni\x18\x0c \x01(\x08\x12,\n$pinned_peer_certificate_chain_sha256\x18\r \x03(\x0c\x12\x31\n)pinned_peer_certificate_public_key_sha256\x18\x0e \x03(\x0c\x12\x16\n\x0emaster_key_log\x18\x0f \x01(\tb\x06proto3')

_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xcapi.xray.transport.internet.tls.config_pb', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
    DESCRIPTOR._loaded_options = None
    _globals['_CERTIFICATE']._serialized_start = 80
    _globals['_CERTIFICATE']._serialized_end = 374
    _globals['_CERTIFICATE_USAGE']._serialized_start = 306
    _globals['_CERTIFICATE_USAGE']._serialized_end = 374
    _globals['_CONFIG']._serialized_start = 377
    _globals['_CONFIG']._serialized_end = 815
