Skip to content

Commit

Permalink
Merge pull request #2180 from nordic-institute/XRDDEV-2535
Browse files Browse the repository at this point in the history
feat: acme support
  • Loading branch information
mikkbachmann authored Jun 11, 2024
2 parents 0aecb62 + 71d6ea1 commit f5710eb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/Manuals/ug-syspar_x-road_v6_system_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ the message log.
| acme-certificate-wait-attempts | 5 | Number of attempts to check whether the ACME certificate is ready before giving up |
| acme-certificate-wait-interval | 5000 | Amount of time in milliseconds to wait between ACME certificate completion check attempts |
| acme-certificate-account-key-pair-expiration | 365 | Amount of days the ACME server account's self-signed certificate is valid |
| acme-challenge-port-enabled | false | If enabled, the API will listen on port 80 for incoming acme challenge requests |

> **NOTE**: `strict-identifier-checks` default value is true for new installations starting from version 7.3.0. It is
> set to `false` in `local.ini` during upgrade process if version installed before upgrade is less than 7.3.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ private SystemProperties() {
public static final String PROXY_UI_API_ACME_ACCOUNT_KEY_PAIR_EXPIRATION_IN_DAYS =
PREFIX + "proxy-ui-api.acme-certificate-account-key-pair-expiration";

/** property name of whether the service should listen on port 80 for incoming acme challenge requests */
public static final String PROXY_UI_API_ACME_CHALLENGE_PORT_ENABLED =
PREFIX + "proxy-ui-api.acme-challenge-port-enabled";

// Proxy ------------------------------------------------------------------

/** Property name of controlling SSL support between Proxies. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ client-use-idle-connection-monitor=true
client-timeout=30000
server-min-supported-client-version=7.3.0

[proxy-ui-api]
acme-challenge-port-enabled=true

[message-log]
message-body-logging=false
acceptable-timestamp-failure-period=172800
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ StartLimitBurst=5
StartLimitIntervalSec=40

[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
User=xroad
Group=xroad
ExecStart=/usr/share/xroad/bin/xroad-proxy-ui-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ StartLimitBurst=5
StartLimitIntervalSec=40

[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
User=xroad
Group=xroad
ExecStart=/usr/share/xroad/bin/xroad-proxy-ui-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import org.apache.catalina.connector.Connector;
import org.apache.coyote.http11.Http11NioProtocol;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Bean;
Expand All @@ -37,6 +38,7 @@
public class AcmeChallengeConfig {

@Profile("nontest")
@ConditionalOnProperty(value = "xroad.proxy-ui-api.acme-challenge-port-enabled", havingValue = "true")
@Bean
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> acmeChallengeCustomizer() {
return this::acmeChallengeCustomizer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
rate-limit-enabled=true
rate-limit-requests-per-second=100
rate-limit-requests-per-minute=1000
acme-challenge-port-enabled=true
[proxy]
backup-encryption-enabled = true
backup-encryption-keyids = "backup.key1@example.org, backup.key2@example.org, backup.key3@example.org"
Expand Down

0 comments on commit f5710eb

Please sign in to comment.