# How to enable HTTPS in my docker container

**URL:** <https://forums.suse.com/t/how-to-enable-https-in-my-docker-container/40306>\
**Category:** General\
**Created:** [March 20, 2023, 1:28am UTC](https://forums.suse.com/t/how-to-enable-https-in-my-docker-container/40306 "2023-03-20T01:28:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cebugdev](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cebugdev/32/9970_2.png) [@cebugdev](https://forums.suse.com/u/cebugdev)\
**Post date:** [March 20, 2023, 1:28am UTC](https://forums.suse.com/t/how-to-enable-https-in-my-docker-container/40306/1 "2023-03-20T01:28:33Z")

</div>

I have a docker container which contains an [ASP.NET](http://ASP.NET) core 6 MVC application and locally I run it with  
ASPNETCORE\_Kestrel\_\_Certificates\_\_Default\_\_Path  
and  
ASPNETCORE\_Kestrel\_\_Certificates\_\_Default\_\_Password  
environmental variables set in docker compose that points to the volume where the certifcate is located, this way the HTTPS is served from docker container.

a simple docker compose such as below

```auto
version: '3.4'

services:
  webapp:
    image: rrs.net
    ports:
      - 80
      - 443
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ASPNETCORE_URLS=https://+:443;http://+:80
      - ASPNETCORE_Kestrel __Certificates__ Default__Password=1234
      - ASPNETCORE_Kestrel __Certificates__ Default__Path=/https/aspnetapp.pfx
    volumes:
      - ~/.aspnet/https:/https:ro

```

How is this done when using Rancher?  
I have tried to go over the menus and option i can see that i can set the environment variables and I can mount a volume, so How can I copy/upload the certificate to that volume (im not sure if this is the way)?

Or general question is, how can I do this in rancher?
