Curl "https://localhost:52311" connection refused

Try -k flag on curl as temp workaround.

If it works, you will need to sort out adding your cert bundle into curl.