1

I have a project where i need to set up a dev environment with letsEncrypt. Self signed cert doesn't work for me as i need to connect to react native, unless i tinker with the android code/ objective-C code, which i dont think is the right thing to do. (Ignore errors for self-signed SSL certs using the fetch API in a ReactNative App?)

I am aware there are some docker projects: https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion/

I followed along to start the NGINX-LETSENCRYPT container, and bind them with my own container using:

docker run --name loginPOC -e "VIRTUAL_HOST=XPS15" -e "LETSENCRYPT_HOST=XPS15" -p 8000:80 -d f91893ef3a6f

Note: f91893ef3a6f(my C# image - web api)

XPS15(local machine)

i only get result when i connect to :

  1. http://xps15:8000/api/values [Works fine]

  2. https://xps15:8000/api/values [HTTPS] [Received "This site can’t provide a secure connection"]

I then check my cert status with

docker exec d9d1b9b5c933 /app/cert_status

Result:No cert status is found.

After some googling i found: https://letsencrypt.org/docs/certificates-for-localhost/ and https://community.letsencrypt.org/t/can-i-use-letsencrypt-in-localhost/21741

I have few questions in mind: 1. Most of the examples they have a top level in their domain name. My doubt is perhaps XPS15 is not a valid host name ?

Appreciate if anyone knows any workaround. Thanks

csamleong
  • 769
  • 1
  • 11
  • 24
  • 2
    You can't get a cert from Let's Encrypt for a domain you don't control. `xps15` is not a valid domain name as it is missing a TLD. Let's Encrypts servers either need to be able to reach yours over the internet via the domain name or you need to do DNS based validation. Either way it must be a valid domain name that you control. – Paul May 15 '18 at 17:02
  • I have never owned an iPhone so I probably can't help much, but there has got to be a simple way to add your self-signed cert to the trusted root cert repo on your device. – Paul May 15 '18 at 17:23
  • @paulpro thanks for pointing xps15 is not a valid domain. At least i know where the problem is at. BTW, most post that i have found linked me to https://stackoverflow.com/questions/32892161/ignore-errors-for-self-signed-ssl-certs-using-the-fetch-api-in-a-reactnative-app/36368360#36368360 which the most recommended way is to use letsencrypt. – csamleong May 16 '18 at 01:09

0 Answers0