<?xml version="1.0" encoding="UTF-8"?>
<OpcServerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <UaServerConfig>
        <!--Trace configuration
            This part of the configuration defines the trace settings for OPC UA Stack and OPC UA Application.-->
        <Trace>
            <!--Enable UA stack trace true/false-->
            <UaStackTraceEnabled>false</UaStackTraceEnabled>
            <!--UA stack trace level. Possible values NONE, ERROR, WARNING, SYSTEM, INFO, DEBUG, CONTENT, ALL-->
            <UaStackTraceLevel>ALL</UaStackTraceLevel>
            <!--Enable UA server application trace true/false-->
            <UaAppTraceEnabled>false</UaAppTraceEnabled>
            <!--UA server application trace level. Possible values NoTrace, Errors, Warning, Info, InterfaceCall, CtorDtor, ProgramFlow, Data-->
            <UaAppTraceLevel>Data</UaAppTraceLevel>
            <!--Maximum number of trace entries in one file-->
            <UaAppTraceMaxEntries>100000</UaAppTraceMaxEntries>
            <!--Maximum number of backup files-->
            <UaAppTraceMaxBackup>5</UaAppTraceMaxBackup>
            <!--Trace file-->
            <UaAppTraceFile>srvTrace.log</UaAppTraceFile>
        </Trace>
        <!--Trace configuration end-->

        <!--Endpoint configuration
            This part of the configuration defines the OPC UA communication endpoints
            for the server and their security configurations-->
        <!--Folder used to store rejected client certificates. Administrators can copy files from here to the trust list.-->
        <RejectedCertificatesDirectory>[ApplicationPath]/pkiserver/rejected</RejectedCertificatesDirectory>
        <!--Maximum number of certificates stored in the rejected directory.-->
        <RejectedCertificatesCount>100</RejectedCertificatesCount>
        <!--List of configured Endpoints end-->
        <UaEndpoint>
            <SerializerType>Binary</SerializerType>
            <!-- URL of the Endpoint
                 This URL is used for Discovery and to open the Endpoints in the UA stack if no StackUrl is configured.
                 [NodeName] can be used as place-holder for the computer name. -->
            <Url>opc.tcp://[NodeName]:48010</Url>
            <!-- Optional URL that allows to define a specific address the stack should use to bind to.
                Can be used to bind the endpoint to a specific network card or to localhost only.
            <StackUrl>opc.tcp://192.168.0.15:48010</StackUrl>
            -->
            <SecuritySetting>
                <SecurityPolicy>http://opcfoundation.org/UA/SecurityPolicy#None</SecurityPolicy>
                <MessageSecurityMode>None</MessageSecurityMode>
            </SecuritySetting>
            <SecuritySetting>
                <SecurityPolicy>http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15</SecurityPolicy>
                <MessageSecurityMode>Sign</MessageSecurityMode>
                <MessageSecurityMode>SignAndEncrypt</MessageSecurityMode>
            </SecuritySetting>
            <SecuritySetting>
                <SecurityPolicy>http://opcfoundation.org/UA/SecurityPolicy#Basic256</SecurityPolicy>
                <MessageSecurityMode>Sign</MessageSecurityMode>
                <MessageSecurityMode>SignAndEncrypt</MessageSecurityMode>
            </SecuritySetting>
            <!-- Flag indicating if the endpoint is provided in GetEndpoints and is therefore visible to a client. Default is true. -->
            <IsVisible>true</IsVisible>
            <!-- Flag indicating if the endpoint URL is provided as discovery URL. Default is true. -->
            <IsDiscoveryUrl>true</IsDiscoveryUrl>
            <!-- This option can be activated if certificates are used only for message security but not for application authentication.
                If set to true, all client certificates will be accepted automatically and they are not stored.
                It is strongly recommended to use this option only together with user authentication. -->
            <AutomaticallyTrustAllClientCertificates>false</AutomaticallyTrustAllClientCertificates>
            <!-- Some of the OPC UA security checks are optional in OPC UA or cause interoperability issues with older OPC UA clients
                 and can be disabled by an administrator of the OPC UA server through the following configuration options. -->
            <SecurityCheckOverwrites>
                <!-- Flag used to disable the ApplicationUri match check between client certificate and parameter in CreateSession.
                     The check is required for compliant OPC UA servers but older clients may provide a wrong ApplicationUri.
                     Default is false. -->
                <DisableApplicationUriCheck>false</DisableApplicationUriCheck>
                <!-- Flag used to disable the client nonce length  check in CreateSession. The check is required for compliant OPC UA
                     servers but older clients may provide a client nonce that is shorter than the required 32 bytes. Default is false. -->
                <DisableNonceLengthCheck>false</DisableNonceLengthCheck>
                <!-- Flag used to disable the client certificate validation error BadCertificateTimeInvalid. Default is false. -->
                <DisableErrorCertificateTimeInvalid>false</DisableErrorCertificateTimeInvalid>
                <!-- Flag used to disable the client certificate validation error BadCertificateIssuerTimeInvalid. Default is false. -->
                <DisableErrorCertificateIssuerTimeInvalid>false</DisableErrorCertificateIssuerTimeInvalid>
                <!-- Flag used to disable the client certificate validation error BadCertificateRevocationUnknown. Default is false. -->
                <DisableErrorCertificateRevocationUnknown>false</DisableErrorCertificateRevocationUnknown>
                <!-- Flag used to disable the client certificate validation error BadCertificateIssuerRevocationUnknown. Default is false. -->
                <DisableErrorCertificateIssuerRevocationUnknown>false</DisableErrorCertificateIssuerRevocationUnknown>
            </SecurityCheckOverwrites>
            <!--Certificate store used for PKI certificate handling. Different Endpoints may have different trust lists.-->
            <CertificateStore>
                <!--File based certificate store used with OpenSSL
                    [ApplicationPath] can be used as place-holder for the application path. -->
                <OpenSSLStore>
                 <CertificateTrustListLocation>/app/Certificates/OPCUA/trusted/</CertificateTrustListLocation>
                 <CertificateRevocationListLocation>/app/Certificates/OPCUA/trusted/crl/</CertificateRevocationListLocation>
                 <IssuersCertificatesLocation>/app/Certificates/OPCUA/pkiserver/issuers/certs/</IssuersCertificatesLocation>
                 <IssuersRevocationListLocation>/app/Certificates/OPCUA/pkiserver/issuers/crl/</IssuersRevocationListLocation>
                 <ServerCertificate>/app/Certificates/OPCUA/pkiserver/own/certs/icpdasuaserver.der</ServerCertificate>
                 <ServerPrivateKey>/app/Certificates/OPCUA/pkiserver/own/private/icpdasuaserver.pem</ServerPrivateKey>
                </OpenSSLStore>
                <!--Windows based certificate store.
                    - <StoreLocation> location of the store. Valid values are LocalMachine and CurrentUser
                    - <StoreName> is the name of the certificate store in the local computer
                    - <ServerCertificateThumbprint> is the thumbprint of the server certificate used to load from store
                <WindowsStore>
                    <StoreLocation>LocalMachine</StoreLocation>
                    <StoreName>UnifiedAutomationUaServerCPP</StoreName>
                    <ServerCertificateThumbprint></ServerCertificateThumbprint>
                </WindowsStore> -->
                <!--Enable server certificate creation if not certificate is not available true/false-->
                <GenerateCertificate>true</GenerateCertificate>
                <!--Settings for a certificate that get generated by the server-->
                <CertificateSettings>
                    <!--Name of the application - [ServerName] is the default value to use the configured server name-->
                    <CommonName>[ServerName]</CommonName>
                    <!--Name of the organization using the OPC UA server-->
                    <Organization>Organization</Organization>
                    <!--Name of the organization unit using the OPC UA server-->
                    <OrganizationUnit>Unit</OrganizationUnit>
                    <!--Name of the location where the OPC UA server is running -->
                    <Locality>LocationName</Locality>
                    <!--State where the OPC UA server is running -->
                    <State></State>
                    <!--Two letter code for country where the OPC UA server is running e.g. DE or US-->
                    <Country>TW</Country>
                    <!--The number of years the certificate is valid for. The maximum accepted number is 20
                        but it is strongly recommended to use a shorter time. -->
                    <YearsValidFor>20</YearsValidFor>
                    <!--Key length of the certificate to create. Valid values are 1024 and 2048 bits-->
                    <KeyLength>1024</KeyLength>
                </CertificateSettings>
            </CertificateStore>
        </UaEndpoint>

        <!--
            Uncomment the next block (UaEndpoint) to enable the HTTPS based profiles.
            This profile works but is not officially supported in this version of the SDK.
            This is the HTTP based protocol that will be supported by embedded devices.
            The HTTPS profile is not completely tested, so you can use it on your own risk.
        -->
        <!--<UaEndpoint>
            <SerializerType>Binary</SerializerType>
            <Url>https://[NodeName]:48011</Url>
            <SecuritySetting>
                <SecurityPolicy>http://opcfoundation.org/UA/SecurityPolicy#None</SecurityPolicy>
                <MessageSecurityMode>None</MessageSecurityMode>
            </SecuritySetting>
            <IsVisible>true</IsVisible>
            <IsDiscoveryUrl>true</IsDiscoveryUrl>
            <AutomaticallyTrustAllClientCertificates>false</AutomaticallyTrustAllClientCertificates>
            <CertificateStore>
                <OpenSSLStore>
                    <CertificateTrustListLocation>[ApplicationPath]/pkiserver/trusted/certs/</CertificateTrustListLocation>
                    <CertificateRevocationListLocation>[ApplicationPath]/pkiserver/trusted/crl/</CertificateRevocationListLocation>
                    <ServerCertificate>[ApplicationPath]/pkiserver/own/certs/uaservercpp.der</ServerCertificate>
                    <ServerPrivateKey>[ApplicationPath]/pkiserver/own/private/uaservercpp.pem</ServerPrivateKey>
                </OpenSSLStore>
                <GenerateCertificate>false</GenerateCertificate>
            </CertificateStore>
        </UaEndpoint>-->
        <!--Endpoint configuration end-->

        <!--Maximum age of a request the server allows. Default value 0 is unlimited-->
        <MaxRequestAge>0</MaxRequestAge>

        <!--Maximum number of sessions the server allows to create. Default value 0 is unlimited-->
        <MaxSessionCount>20</MaxSessionCount>
        <!--Maximum number of sessions the server allows per Client, 0 is unlimited-->
        <MaxSessionsPerClient>0</MaxSessionsPerClient>
        <!--Minimum time-out in ms for a sessions the server allows to set. Default value 0 is unlimited-->
        <MinSessionTimeout>10000</MinSessionTimeout>
        <!--Maximum time-out in ms for a sessions the server allows to set. Default value 0 is unlimited-->
        <MaxSessionTimeout>3600000</MaxSessionTimeout>

        <!--Maximum number of Browse Continuation Points managed by a session. Default value 0 is using internal default settings-->
        <MaxBrowseContinuationPoints>0</MaxBrowseContinuationPoints>
        <!--Maximum number of Browse results for one browse operation. Default value 0 is using internal default settings-->
        <MaxBrowseResults>0</MaxBrowseResults>

        <!--Maximum number of History Continuation Points managed by a session. Default value 0 is using internal default settings-->
        <MaxHistoryContinuationPoints>0</MaxHistoryContinuationPoints>

        <!--Minimum publishing interval in milliseconds the server allows-->
        <MinPublishingInterval>50</MinPublishingInterval>
        <!--Maximum publishing interval in milliseconds the server allows. Default value 0 is no limitation-->
        <MaxPublishingInterval>0</MaxPublishingInterval>
        <!--Minimum KeepAlive interval  in milliseconds the server allows-->
        <MinKeepAliveInterval>5000</MinKeepAliveInterval>
        <!--Minimum Subscription lifetime in milliseconds the server allows-->
        <MinSubscriptionLifetime>10000</MinSubscriptionLifetime>
        <!--Maximum Subscription lifetime in milliseconds the server allows. Default value 0 is no limitation-->
        <MaxSubscriptionLifetime>0</MaxSubscriptionLifetime>
        <!--Maximum number of messages in the republish queue the server allows per Subscription.-->
        <MaxRetransmissionQueueSize>20</MaxRetransmissionQueueSize>
        <!--Maximum number of notifications per Publish the server allows. Default value 0 is no limitation-->
        <MaxNotificationsPerPublish>0</MaxNotificationsPerPublish>
        <!--Maximum size of monitored item data queues.-->
        <MaxDataQueueSize>100</MaxDataQueueSize>
        <!--Maximum size of monitored item event queues.-->
        <MaxEventQueueSize>10000</MaxEventQueueSize>
        <!--Maximum number of subscriptions the server allows to create. Default value 0 is unlimited-->
        <MaxSubscriptionCount>0</MaxSubscriptionCount>
        <!--Maximum number of subscriptions the server allows to create per Session. Default value 0 is unlimited-->
        <MaxSubscriptionsPerSession>10</MaxSubscriptionsPerSession>
        <!--Maximum number of monitored items the server allows to create. Default value 0 is unlimited-->
        <MaxMonitoredItemCount>0</MaxMonitoredItemCount>
        <!--Maximum number of monitored items per subscriptions the server allows to create. Default value 0 is unlimited-->
        <MaxMonitoredItemPerSubscriptionCount>0</MaxMonitoredItemPerSubscriptionCount>
        <!--Maximum number of monitored items per session the server allows to create. Default value 0 is unlimited-->
        <MaxMonitoredItemPerSessionCount>0</MaxMonitoredItemPerSessionCount>

        <!--Minimum sample interval supported by the server-->
        <MinSupportedSampleRate>0</MinSupportedSampleRate>

        <!--Settings for the sampling engine.-->
        <AvailableSamplingRates>
            <SamplingRate>0</SamplingRate>
            <SamplingRate>50</SamplingRate>
            <SamplingRate>100</SamplingRate>
            <SamplingRate>250</SamplingRate>
            <SamplingRate>500</SamplingRate>
            <SamplingRate>1000</SamplingRate>
            <SamplingRate>2000</SamplingRate>
            <SamplingRate>5000</SamplingRate>
            <SamplingRate>10000</SamplingRate>
        </AvailableSamplingRates>

        <!--Settings for the available LocaleIds known to be supported by the server.-->
        <AvailableLocaleIds>
            <LocaleId>en</LocaleId>
        </AvailableLocaleIds>

        <!--Settings for the available UA profiles known to be supported by the server.-->
        <AvailableServerProfiles>
            <ServerProfileUri>http://opcfoundation.org/UAProfile/Server/StandardUA</ServerProfileUri>
            <ServerProfileUri>http://opcfoundation.org/UAProfile/Server/DataAccess</ServerProfileUri>
            <ServerProfileUri>http://opcfoundation.org/UAProfile/Server/Methods</ServerProfileUri>
            <ServerProfileUri>http://opcfoundation.org/UAProfile/Server/NodeManagement</ServerProfileUri>
            <ServerProfileUri>http://opcfoundation.org/UAProfile/Server/EventSubscription</ServerProfileUri>
        </AvailableServerProfiles>

        <!--Flag indicating if audit events are activated-->
        <IsAuditActivated>false</IsAuditActivated>

        <!--Settings for the thread pools used in the server application-->
        <ThreadPoolSettings>
            <MinSizeTransactionManager>1</MinSizeTransactionManager>
            <MaxSizeTransactionManager>10</MaxSizeTransactionManager>
            <MinSizeSubscriptionManager>1</MinSizeSubscriptionManager>
            <MaxSizeSubscriptionManager>10</MaxSizeSubscriptionManager>
        </ThreadPoolSettings>

        <!--Build information for the server application software-->
        <ProductUri>urn:ICPDAS:UA-5000</ProductUri>
        <ManufacturerName>ICPDAS</ManufacturerName>
        <ProductName>UA-5000</ProductName>
        <SoftwareVersion>1.4.0</SoftwareVersion>
        <BuildNumber>258</BuildNumber>
        <!--Build information end-->

        <!--Server instance information defined for the server installation.
            [NodeName} can be used as place-holder for the computer name. -->
        <ServerUri>urn:[NodeName]:ICPDAS:ICPDAS_OPC_UA_Server</ServerUri>
        <ServerName>ICPDAS_OPC_UA_Server@[NodeName]</ServerName>
        <!--Server instance information end-->

        <!--Configuration for supported user identity tokens-->
        <UserIdentityTokens>
            <!--Enable anonymous login true/false-->
            <EnableAnonymous>true</EnableAnonymous>
            <!--Enable user/password login true/false-->
            <EnableUserPw>true</EnableUserPw>
            <!--Enable certificate based user login true/false-->
            <EnableCertificate>false</EnableCertificate>
        </UserIdentityTokens>
        <!--User identity token configuration end-->

        <!--Discovery configuration
            Configuration for registration with discovery server(s)-->
        <DiscoveryRegistration>
            <!--Flag indicating if the certificates should be exchanged with the windows certificate store -->
            <AutomaticCertificateExchange>false</AutomaticCertificateExchange>
            <!--Path of the local discovery server trust list. This is where the server copies it's certificate to
                if the file based store of the new LDS is used. -->
            <DiscoveryServerTrustListLocation></DiscoveryServerTrustListLocation>
            <!--Store name used for the local discovery server in the windows certificate store -->
            <DiscoveryServerStoreName>UA Applications</DiscoveryServerStoreName>
            <!--Certificate name of the local discovery server in the windows certificate store -->
            <DiscoveryServerCertificateName>UA Local Discovery Server</DiscoveryServerCertificateName>
            <!--Interval in milliseconds for registration with discovery server(s) -->
            <RegistrationInterval>30000</RegistrationInterval>
            <!--List of discovery servers to register with.
                If the list is empty, no registration is executed.
                Default is opc.tcp://localhost:4840 for the local discovery server.
                Additional remote discovery servers can be added-->
            <Url>opc.tcp://127.0.0.1:4840</Url>
        </DiscoveryRegistration>
        <!--Discovery configuration end-->

        <!--Serializer configuration
          This part of the configuration defines the OPC UA Stack serializer settings.
          These are the Security constraints for the serializer. Set this values carefully.-->
        <Serializer>
            <!--The largest size for a memory block the serializer can do when deserializing a message-->
            <MaxAlloc>16777216</MaxAlloc>
            <!--The largest string accepted by the serializer-->
            <MaxStringLength>16777216</MaxStringLength>
            <!--The largest byte string accepted by the serializer-->
            <MaxByteStringLength>16777216</MaxByteStringLength>
            <!--Maximum number of elements in an array accepted by the serializer-->
            <MaxArrayLength>65536</MaxArrayLength>
            <!--The maximum number of bytes per message in total-->
            <MaxMessageSize>16777216</MaxMessageSize>
        </Serializer>
        <!--Serializer configuration end-->

        <!--Settings for the thread pools used in the OPC UA Stack-->
        <StackThreadPoolSettings>
            <!--Controls whether the secure listener uses a thread pool to dispatch received requests-->
            <Enabled>false</Enabled>
            <!--The minimum number of threads in the thread pool-->
            <MinThreads>5</MinThreads>
            <!--The maximum number of threads in the thread pool-->
            <MaxThreads>5</MaxThreads>
            <!--The length of the queue with jobs waiting for a free thread-->
            <MaxJobs>20</MaxJobs>
            <!--If MaxJobs is reached the add operation can block or return an error-->
            <BlockOnAdd>true</BlockOnAdd>
            <!--If the add operation blocks on a full job queue, this value sets the maximum waiting time. 0 is infinite-->
            <Timeout>0</Timeout>
        </StackThreadPoolSettings>

        <!--Provides the redundancy settings for the server-->
        <RedundancySettings>
          
        </RedundancySettings>

    </UaServerConfig>
    <General>
    </General>
</OpcServerConfig>
