Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We implement https based on spring boot, and implement https through configuration and http coding.

Currently doris uses many ports, so http and https are not supported at the same time. We could choose http or https by setting "ssl_enable" in fe.conf.


Generate an SSL Certificate

    1. Test environment certificate is generated using keytool or openssl, and production environment certificate is purchased from the CA.
  1. Configure https in Spring Boot
    1. Add ssl certificate configuration items in the fe configuration file, including the port number, certificate path, password, format, alias, and enable or disable (ssl is disabled by default).

      http_port
      https_port = 8040
      ssl_key_store_path
      ssl_key_store_password
      ssl_key_store_type
      ssl_key_store_alias
      ssl_enable


    2. When fe is started, related configuration parameters are read into the HttpServer class, and then ssl parameters are configured using SpringApplicationBuilder().properties(properties).

      server.port = https_port // https端口
      server.http.port = http_port // http端口
      server.ssl.key-store = ssl_key_store_path // 证书路径
      server.ssl.key-store-password = ssl_key_store_password // 证书密码
      server.ssl.key-store-type = ssl_key_store_type // 密钥库类型
      server.ssl.keyalias: ssl_key_store_alias // 证书别名
      server.ssl.enabled = ssl_enable // 是否开启ssl


  2. Implement http connector and redirect http requests to https
    1. Construct the httpConnector and set the http port and https port.
    2. Through TomcatServletWebServerFactory::addAdditionalTomcatConnectors() to add multiple surveillance connection.

...