Accessing website on https fails on the first run when using On-Demand TLS

This looks like the same problem as Internal SSL "certificate is not standards compliant" on macOS - #3 by matt