I'm getting an issue while deploying a .net-core web-API to a Docker container on Ubuntu. Everything works as expected, but from my application, I need to call other services via https and those hosts use certificates signed by self-maintained root certificates.

In this scenario, I get SSL-errors while calling this services (SSL-not valid) and therefore I need to install this root-certificate in the docker-container or somehow use the root-certificate in the .net-core application.

How can this be done? Is there a best practice to handle this situation? Will .net-core access the right keystore on the Ubuntu?

Solution:

Since .NET Core uses OpenSSL on Linux, you need to set up your Linux environment in the container so that OpenSSL will pick up the certificate.

This is done by (+ Dockerfile examples):

Copying the the certificate .crt file to a location that update-ca-certificates will scan for trusted certificates - e.g. /usr/local/share/ca-certificates/ oron RHEL /etc/pki/ca-trust/source/anchors/:

Blogs

Sarkari Support & Help

Contact us

support[at]askgif[dot]com

Follow us

Adhe Idhar Jao Adhe Udhar Jao

Baki hamare piche ao

1. TERMS

By accessing the website at https://askgif.com/, you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this website are protected by applicable copyright and trademark law.

2. USE LICENSE

Permission is granted to temporarily download one copy of the materials (information or software) on AskGif's website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:

modify or copy the materials;

use the materials for any commercial purpose, or for any public display (commercial or non-commercial);

attempt to decompile or reverse engineer any software contained on AskGif's website;

remove any copyright or other proprietary notations from the materials; or

transfer the materials to another person or "mirror" the materials on any other server.

This license shall automatically terminate if you violate any of these restrictions and may be terminated by AskGif at any time. Upon terminating your viewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or printed format.