証明書を使用してコンテナを実行して C# で HTTPS を使用する
証明書を使用してコンテナを実行する必要がある場合は、次の手順に従って証明書を生成し、ローカル マシンを構成します。
証明書を使用して IronSecureDoc コンテナを実行する
1.証明書を生成する:
# 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 --trust # 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 --trust<CREDENTIAL_PLACEHOLDER>をパスワードに置き換えます。
Dockerコンテナを実行します。
# 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.# 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.SHELL<IRONSECUREDOC_LICENSE_KEY>と<CERTIFICATE_PASSWORD>をそれぞれ実際のIronSecureDocライセンスキーと証明書パスワードに置き換えてください。
よくある質問
なぜドキュメントのセキュリティに HTTPS が重要なのか?
HTTPS はデータ転送を暗号化し、機密情報が転送中に傍受されることなく秘密に保たれるようにするため、ドキュメントのセキュリティにとって非常に重要です。
自分のアプリケーション用に HTTPS 証明書を作成するにはどうすればいいですか?
ASP.NET Core で使用するために新しい証明書を生成するには、コマンド dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\ironsecuredoc.pfx -p <CREDENTIAL_PLACEHOLDER> を実行して HTTPS 証明書を作成できます。
自分のローカルマシンで HTTPS 証明書が信頼されていることを確認するにはどうすればよいですか?
ローカルマシンで HTTPS 証明書を信頼するには、コマンド dotnet dev-certs https --trust を使用します。このコマンドは、生成された証明書をシステムに信頼させるように設定します。
HTTPS サポートを利用した Docker コンテナを実行するプロセスは何ですか?
HTTPS サポート付きで Docker コンテナを実行するには、HTTP および HTTPS ポートを公開し、IronSecureDoc_LicenseKey や CERTIFICATE_PASSWORD などの必要な環境変数を設定し、証明書のディレクトリを読み取り専用としてマウントします。
Docker セットアップで HTTPS 用にどのポートを設定すべきですか?
Docker セットアップで HTTPS を設定するには、ホストポートにコンテナポートをマッピングし、ポート 8081 を HTTPS 用、ポート 8080 を HTTP 用に公開します。
Docker コンテナに証明書のパスワードを渡すにはどうすればよいですか?
Docker 実行コマンドを実行するときに環境変数 CERTIFICATE_PASSWORD を使用して Docker コンテナに証明書のパスワードを渡します。
Docker で環境を「Production」として設定するために必要な手順は何ですか?
Docker で環境を「Production」として設定するには、Docker 実行コマンドに環境変数 ENVIRONMENT=Production を設定します。
Docker コマンドでプレースホルダーはどのように処理されるべきですか?
Docker コマンドでは、<IRONSECUREDOC_LICENSE_KEY> や <CERTIFICATE_PASSWORD> などのプレースホルダーを実際の IronSecureDoc ライセンスキーと証明書パスワードに置き換えて、適切な機能を確保します。





