IDP addon doesn't work with HTTPS?

I’m running HTTPS locally using Caddy and this loads fine accessing the app from the localhost dns (for the purpose of this post, let’s call it https://myapp.localhost/app/)

The login page appears, and this comes up in the log:

18:46:46.360 WARN  c.h.a.i.i.controllers.IdpController     - Incorrect serviceProviderUrl http://myapp.localhost/app/ passed, will be used default

It is however a https address in the browser. I can proceed with login despite the warning. Unfortunately, upon logging in successfully, I get HTTP ERROR 500 in the next screen. The following appear in the log:

18:48:34.853 INFO  c.h.a.i.i.controllers.IdpController     - Logged in IDP session with ticket 8ccd325cca650a6f5d95335d183316d9, user: admin
18:48:36.938 ERROR c.h.a.i.w.s.idp.BaseIdpSessionFilter    - Unable to obtain IDP session by ticket No such host is known (myapp.localhost)
	at ~[idp-web-0.3.0.jar:na]

Do note that when running localhost without Caddy, in http, everything works correctly. However, the application will definitely need to work in https when going to production.

Appreciate if anyone could point me to the right direction or offer some help, as I’ve been trying various settings in my but nothing resolved this.