🔐HTTPS

Pretty secure until you start using deflate

You can enable HTTPS automatically:

app := indigo.New(":8080").
    AutoHTTPS(":8443")

This will run plain HTTP on port 8080 and HTTPS on port 8443.

AutoHTTPS() uses autocert internally. However, if passed address is an IP (and in the example, it's implicitly set to 0.0.0.0), the autocert cannot be used. A self-signed certificate is generated in the case.

Own certificates can also be supplied:

app := indigo.New(":8080").
    HTTPS("/path/to/domain.crt", "/path/to/domain.key")

Last updated