6.28.5 Enabling HTTP and HTTPS

Micronaut supports binding both HTTP and HTTPS out of the box. To enable dual protocol support, modify your configuration. For example with application.yml:

Dual Protocol Configuration Example

  1. micronaut:
  2. ssl:
  3. enabled: true
  4. buildSelfSigned: true (1)
  5. server:
  6. dualProtocol : true (2)
1You will need to configure ssl for https to work. In this example we are just using self signed but see Securing the Server with HTTPS for other configurations
2To enable http & https is an opt-in feature, setting the dualProtocol flag enables that, by default Micronaut will only enable one or the other