HTTP and HTTPS - Skullabs/kikaha GitHub Wiki

HTTP and HTTPS

Kikaha comes with a few modules out-of-box, two of them are HTTP and HTTPS modules. Both allow developers to listen, respectively, HTTP and HTTPS requests. Bellow is described how to enable and configure these modules.

Listening to HTTP requests

The HTTP module comes enabled by default. Developers could configure through the application.yml file as shown bellow.

server:
  http:
    enabled: true
    host: "0.0.0.0"
    port: 9000

All HTTP properties is placed at the server.http and has the following attributes:

  • enabled: defines when the HTTP module is enabled. (default: true)
  • host: defines which address the HTTP socket should be bound to. (default: 0.0.0.0)
  • port: defines which port the HTTP socket should listen to connections (default: 9000)

Enabling HTTPS

The HTTPS module comes disabled by default. To configure a HTTPS you can enable it in a similar approach as shown above at the HTTP module. Bellow is the default HTTPS module configuration.

server:
  https:
    enabled: false
    host: '0.0.0.0'
    port: 9001

    keystore: "server.keystore"
    keystore-security-provider: "JKS"
    password: "password"

    truststore: "server.truststore"
    cert-security-provider: "TLS"

    redirect-to-http: true

All HTTPS properties is placed at the server.https and has the following attributes:

  • enabled: defines when the HTTPS module is enabled. (default: false)
  • host: defines which address the HTTPS socket should be bound to. (default: 0.0.0.0)
  • port: defines which port the HTTPS socket should listen to connections (default: 9001)
  • keystore: defines the signed certificate stored in a Java keystore format
  • keystore-security-provider: the keystore security provider. (default: JKS)
  • truststore: the truststore certificate. (optional)
  • cert-security-provider: the truststore certificate provider. (default: TLS)
  • password: the certificate password
  • redirect-to-http: if set to true will make all requests made to HTTP being redirected to the HTTPS port.