Skip to content

Commit d451fa2

Browse files
committed
MINOR: global: add ssl-load-extra-del-ext option
Expose the ssl-load-extra-del-ext global keyword, already handled by the config-parser, as ssl_options.load_extra_del_ext so it can be managed through the API.
1 parent fa9c30b commit d451fa2

12 files changed

Lines changed: 37 additions & 2 deletions

File tree

.aspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ allowed:
7373
- epoll
7474
- escaper
7575
- eslint
76+
- ext
7677
- failsafe
7778
- fbt
7879
- fcgi

configuration/convert/v2v3/convert_global.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ func GlobalV2ToV3(v2g *v2.Global) (*v3.GlobalBase, error) { //nolint:maintidx
159159
Propquery: v2g.SslPropquery,
160160
Provider: v2g.SslProvider,
161161
ProviderPath: v2g.SslProviderPath,
162+
// LoadExtraDelExt: not present in v2
162163
// SecurityLevel: not present in v2
163164
ServerVerify: v2g.SslServerVerify,
164165
SkipSelfIssuedCa: v2g.SslSkipSelfIssuedCa,

configuration/global.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,15 @@ func parseSSLOptions(p parser.Parser) (*models.SslOptions, error) { //nolint:goc
869869
options.LoadExtraFiles = sslLoadExtraFiles
870870
}
871871

872+
sslLoadExtraDelExt, err := parseBoolOption(p, "ssl-load-extra-del-ext")
873+
if err != nil {
874+
return nil, err
875+
}
876+
if sslLoadExtraDelExt {
877+
isEmpty = false
878+
options.LoadExtraDelExt = sslLoadExtraDelExt
879+
}
880+
872881
sslPassphraseCmd, err := parseStringOption(p, "ssl-passphrase-cmd")
873882
if err != nil {
874883
return nil, err
@@ -3136,6 +3145,10 @@ func serializeSSLOptions(p parser.Parser, options *models.SslOptions) error { //
31363145
return err
31373146
}
31383147

3148+
if err := serializeBoolOption(p, "ssl-load-extra-del-ext", options.LoadExtraDelExt); err != nil {
3149+
return err
3150+
}
3151+
31393152
if err := serializeStringOption(p, "ssl-passphrase-cmd", options.PassphraseCmd); err != nil {
31403153
return err
31413154
}

models/ssl_options.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/ssl_options_compare_test.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/ssloptions_diff_generated.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/ssloptions_equal_generated.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/build/haproxy_spec.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,10 @@ definitions:
14981498
x-omitempty: true
14991499
issuers_chain_path:
15001500
type: string
1501+
load_extra_del_ext:
1502+
description: Remove the certificate file extension before appending the extra file extension (foobar.crt loads foobar.key instead of foobar.crt.key)
1503+
type: boolean
1504+
x-display-name: SSL Load Extra Del Ext
15011505
load_extra_files:
15021506
type: string
15031507
x-display-name: SSL Load Extra Files

specification/models/configuration/global.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,10 @@ ssl_options:
10571057
load_extra_files:
10581058
type: string
10591059
x-display-name: SSL Load Extra Files
1060+
load_extra_del_ext:
1061+
type: boolean
1062+
x-display-name: SSL Load Extra Del Ext
1063+
description: Remove the certificate file extension before appending the extra file extension (foobar.crt loads foobar.key instead of foobar.crt.key)
10601064
default_bind_options:
10611065
type: string
10621066
x-display-name: SSL Default Bind Options

test/configuration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ global
218218
stats maxconn 20
219219
stats calculate-max-counters on
220220
ssl-load-extra-files bundle
221+
ssl-load-extra-del-ext
221222
deviceatlas-json-file atlas.json
222223
deviceatlas-log-level 1
223224
deviceatlas-separator -

0 commit comments

Comments
 (0)