Skip to content

Conversation

@bneradt
Copy link
Contributor

@bneradt bneradt commented Dec 11, 2025

Replace the ssl_multicert.config format with YAML format, following the pattern established by sni.yaml. The new ssl_multicert.yaml uses a top-level 'ssl_multicert' key containing a sequence of certificate entries.

This also supports config conversion via:

traffic_ctl config ssl_multicert <old_config> <new_config>

Community Decisions

  • Do we want these conversion scripts to be python or c++ files? This implements the conversion via traffic_ctl config convert per @cmcfarlen 's suggestion.
  • Do we want to support both the old and new formats at the same time? At 10.x, we transitioned to only supporting records.yaml, so we have that as maybe something of a precedent. This PR supports both the old and new formats, but we have to decide on our policy for the old formats for 11.

At least for ssl_multicert, either of these options are possible from an implementation standpoint.

@cmcfarlen had an interesting suggestion to bake the config conversion logic into traffic_ctl. Maybe have something like:

traffic_ctrl config convert ssl_multicert|plugins|... <old_path> <new_path>

@bneradt bneradt added this to the 11.0.0 milestone Dec 11, 2025
@bneradt bneradt self-assigned this Dec 11, 2025
@bneradt bneradt force-pushed the convert_ssl_multicert_config_to_remap branch from 9b6767b to 4cb0241 Compare December 11, 2025 21:23
@bneradt bneradt force-pushed the convert_ssl_multicert_config_to_remap branch 5 times, most recently from 601f7d5 to 145da27 Compare December 12, 2025 19:31
Replace the ssl_multicert.config format with YAML format, following the
pattern established by sni.yaml. The new ssl_multicert.yaml uses a
top-level 'ssl_multicert' key containing a sequence of certificate
entries.

This also supports config conversion via:
traffic_ctl config ssl_multicert <old_config> <new_config>
@bneradt bneradt force-pushed the convert_ssl_multicert_config_to_remap branch from 145da27 to 72e817d Compare December 12, 2025 21:08
@bryancall bryancall requested a review from Copilot December 15, 2025 22:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 198 out of 198 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (3)

tests/gold_tests/tls/tls_check_dual_cert_selection.test.py:56

  • The test is still using legacy format syntax in AddLines() after changing from ssl_multicert_config to ssl_multicert_yaml. Lines 53-56 contain legacy format entries like 'ssl_cert_name=signed-foo-ec.pem,signed-foo.pem' which should be converted to YAML format to match the migration pattern used consistently in other test files.
    tests/gold_tests/tls/tls_check_cert_select_plugin.test.py:52
  • Similar to tls_check_dual_cert_selection.test.py, this test is still using legacy format syntax after changing to ssl_multicert_yaml. Lines 49-52 should be converted to YAML format to be consistent with the migration pattern.
    tests/gold_tests/tls/tls_check_cert_selection_reload.test.py:46
  • This test is still using legacy format syntax in AddLines() after changing to ssl_multicert_yaml. Lines 44-46 contain legacy format entries which should be converted to YAML format for consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to 45
ts.Disk.ssl_multicert_yaml.AddLines(
[
'dest_ip=* ssl_cert_name=passphrase.pem ssl_key_name=passphrase.key ssl_key_dialog="exec:/bin/bash -c \'echo -n passphrase\'"',
])
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is still using legacy format syntax after changing to ssl_multicert_yaml. Lines 44-45 contain legacy format entries which should be converted to YAML format for consistency with the migration pattern.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to 71
tr2.Disk.ssl_multicert_yaml.AddLines(
[
'dest_ip=* ssl_cert_name=passphrase2.pem ssl_key_name=passphrase2.key ssl_key_dialog="exec:/bin/bash -c \'echo -n passphrase\'"',
])
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second occurrence in this file also uses legacy format syntax after the migration. Lines 69-71 should be converted to YAML format.

Copilot uses AI. Check for mistakes.

std::string
SSLMultiCertMarshaller::to_json(SSLMultiCertConfig const &config)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the yamlcpp to emit json? Although there is not a direct way, you can emulate it:

YAML:Emitter Emitter;
emitter << YAML:: DoubleQuoted << YAML::Flow << /* rest of code */;

traffic_ctl is using this.

There are some limitation though.

// ssl-multicert subcommand
auto &ssl_multicert_command =
config_command.add_command("ssl-multicert", "Manage ssl_multicert configuration").require_commands();
ssl_multicert_command.add_command("show", "Show the ssl_multicert configuration in JSON format", Command_Execute)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default is JSON?? does it make sense to drop YAML too? should be straight forward as the YAML node is what we read from the file.?

if so, I'd suggest using mutex groups for the options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants