Can't get an SSL secure Uvicorn server

So i know the embeded version of spaces delivers an https url, but it does not mean the server is acutally secure. My frontend gives me errors on the CORS. When i add my certificates to the Uvicorn server, i get a 500 error from hugging face but no error message.
Any idea on how to solve this?

Thanks:)