How can I configure my Docker microservice to use SSL/HTTPS?

I have created a Docker microservice image using the 'compiler.package.microserviceDockerImage' workflow. It is working correctly, but I would like to configure it to use HTTPS instead of HTTP. How can I accomplish this? I have an existing private key that I would like to use.

 채택된 답변

You can configure your Docker microservice API to use HTTPS/SSL by postpending the "--x509-private-key" argument to the "docker" command you use to run your image.
For example, if you use this command to run your image:
docker run --rm -p 9900:9910 image-name
Then you can change it to the following:
docker run --rm -p 9900:9910 image-name --x509-private-key <FILE>
Where <FILE> is the name of the file that contains your private key, in PEM format.
For more information, please see the following documentation page:

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Microservices에 대해 자세히 알아보기

제품

릴리스

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by