USE HTTPS in C# by Running the Container with a Certificate
If you need to run the container with a certificate, follow these steps to generate the certificate and configure the local machine:
Run the IronSecureDoc Container With a Certificate
-
Generate Certificate:
# Generates a new HTTPS certificate for use with ASP.NET Core. # Saves the certificate at the specified path and protects it with a password. dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\ironsecuredoc.pfx -p <CREDENTIAL_PLACEHOLDER> # Trusts the generated certificate on your local machine. dotnet dev-certs https --trustSHELLReplace
<CREDENTIAL_PLACEHOLDER>with a password. -
Run the Docker Container:
# Runs the IronSecureDoc Docker container with both HTTP and HTTPS ports exposed. docker container run -d \ -p 8081:8081 -p 8080:8080 \ # Maps container ports to host ports for HTTP and HTTPS. -e HTTP_PORTS=8080 \ # Sets the HTTP port for the application. -e HTTPS_PORTS=8081 \ # Sets the HTTPS port for the application. -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> \ # Provides the IronSecureDoc license key. -e ENVIRONMENT=Production \ # Configures the environment as Production. -v %USERPROFILE%\.aspnet\https:/https:ro \ # Mounts the directory to the container as read-only. -e CERTIFICATE_PATH=%USERPROFILE%\.aspnet\https\ironsecuredoc.pfx \ # Specifies the path to the certificate in the container. -e CERTIFICATE_PASSWORD=<CERTIFICATE_PASSWORD> \ # Password for the certificate. ironsoftwareofficial/ironsecuredoc:latest # Specifies the Docker image to use.SHELLReplace
<IRONSECUREDOC_LICENSE_KEY>and<CERTIFICATE_PASSWORD>with your actualIronSecureDoclicense key and certificate password, respectively.
Frequently Asked Questions
How do I generate a new HTTPS certificate for IronSecureDoc?
You can use the `dotnet dev-certs https -ep` command to generate a new HTTPS certificate for use with ASP.NET Core, saving it at the specified path and protecting it with a password.
How can I trust the generated HTTPS certificate on my local machine?
To trust the generated certificate on your local machine, use the command `dotnet dev-certs https --trust`.
What steps are required to run the IronSecureDoc Docker container?
To run the IronSecureDoc Docker container, you need to map container ports to host ports for HTTP and HTTPS, set environment variables including `IronSecureDoc_LicenseKey`, and mount the directory for the HTTPS certificate as read-only.
Which environment variable is used to set the HTTPS port for the IronSecureDoc application?
The environment variable `HTTPS_PORTS` is used to set the HTTPS port for the IronSecureDoc application.
Why do I need to add the path to the HTTPS certificate in the Docker container?
Adding the path to the HTTPS certificate in the Docker container, specified by `CERTIFICATE_PATH`, ensures that the container can access the certificate for secure communications.
What should I replace in the IronSecureDoc setup commands?
In the setup commands, replace `
What Docker image should I use to deploy IronSecureDoc?
You should use the Docker image `ironsoftwareofficial/ironsecuredoc:latest` to deploy IronSecureDoc.
How do I configure the IronSecureDoc environment as Production?
Set the environment variable `ENVIRONMENT=Production` to configure the IronSecureDoc application as a Production environment.

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.