DS Server is a ready-to-use backend for document processing. It allows users to edit, view, merge, and create PDF and Word documents via API. The server supports .NET Core, Docker, and Linux environments and offers integrated OAuth security. It is designed for enterprise applications requiring robust document handling. The service runs as an ASP.NET Core application and can be deployed on Windows or Linux servers. Many customers host it as part of their web infrastructure to enable browser-based document editing in enterprise applications. When running TX Text Control Document Services directly with the .NET runtime, the service is typically started like this: dotnet TXTextControl.DocumentServices.dll In this configuration, the application uses Kestrel, the built-in web server of ASP.NET Core, to run. To securely expose the service over the Internet or within a corporate network, enable HTTPS using a TLS certificate. This article demonstrates two methods for configuring HTTPS for Document Services: Configure the certificate directly in appsettings.json Provide the certificate password securely using environment variables Both approaches are compatible with the default ASP.NET Core configuration system. Configuring HTTPS in appsettings.json Kestrel endpoints can be defined in the application's configuration file. The following example shows how to configure an HTTPS endpoint on port 5001 using a PFX certificate: { "Kestrel": { "Endpoints": { "Https": { "Url": "https://0.0.0.0:5001", "Certificate": { "Path": "certificate.pfx", "Password": "123" } } } } } The complete appsettings.json file would look like this: { "Kestrel": { "Endpoints": { "Https": { "Url": "https://0.0.0.0:5001", "Certificate": { "Path": "certificate.pfx", "Password": "123" } } } }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information", "TXTextControl.DocumentServices": "Information" }, "DSServerFile": { "Options": { "FolderPath": "./logs", "FileName": "log_{dateTime}.log" } } }, "AllowedHosts": "*", "LiteDbOptions": { "DatabaseFileName": "Admin.db" } } With this configuration in place, starting the server automatically enables HTTPS: dotnet TXTextControl.DocumentServices.dll Kestrel loads the certificate from the specified PFX file and starts providing secure connections. This straightforward approach works well for local development or internal deployments. Using Environment Variables for the Certificate Password For production deployments, it is usually not recommended to store sensitive information, such as certificate passwords, directly in configuration files. ASP.NET Core allows configuration values to be overridden using environment variables. These variables map to configuration keys using a double underscore (__) as a separator. Therefore, remove the password from the configuration file and set it as an environment variable instead: { "Kestrel": { "Endpoints": { "Https": { "Url": "https://0.0.0.0:5001", "Certificate": { "Path": "certificate.pfx" } } } } } Provide the Password via Environment Variable Set the environment variable for the certificate password: Windows (PowerShell): $env:Kestrel__Endpoints__Https__Certificate__Password="yourpassword" dotnet TXTextControl.DocumentServices.dll Linux/macOS (Bash): export Kestrel__Endpoints__Https__Certificate__Password="yourpassword" dotnet TXTextControl.DocumentServices.dll The configuration system resolves this variable to the internal configuration key: Kestrel:Endpoints:Https:Certificate:Password At runtime, the environment variable overrides the value in appsettings.json. Recommended Deployment Structure A common production layout involves separating configuration, certificates, and logs. For example: /app /app/appsettings.json /app/certs/certificate.pfx /app/logs This structure allows certificates and secrets to be managed independently from the application binaries. Conclusion Using the ASP.NET Core configuration system, enabling HTTPS for TX Text Control Document Services with Kestrel is straightforward. Define the certificate in appsettings.json and securely provide the password via environment variables to ensure secure communication for your document processing service in production environments.