6.27.4 Securing the Server with HTTPS

Micronaut supports HTTPS out of the box. By default HTTPS is disabled and all requests are served using HTTP. To enable HTTPS support, modify your configuration. For example with application.yml:

HTTPS Configuration Example

  1. micronaut:
  2. ssl:
  3. enabled: true
  4. buildSelfSigned: true (1)
1Micronaut will create a self-signed certificate.
By default Micronaut with HTTPS support starts on port 8443 but you can change the port the property micronaut.ssl.port.
Keep in mind that this configuration will generate a warning on the browser.

https warning