Skip to content

Support ni-tls-config Directory Scheme and Add TLS Configuration Templates#1260

Merged
texasaggie97 merged 6 commits into
ni:mainfrom
texasaggie97:dev/texasaggie97/fix-ni-tls-config-trusted-directory
May 12, 2026
Merged

Support ni-tls-config Directory Scheme and Add TLS Configuration Templates#1260
texasaggie97 merged 6 commits into
ni:mainfrom
texasaggie97:dev/texasaggie97/fix-ni-tls-config-trusted-directory

Conversation

@texasaggie97
Copy link
Copy Markdown
Contributor

@texasaggie97 texasaggie97 commented May 1, 2026

What does this Pull Request accomplish?

This PR enables mutual TLS support in grpc-device through integration with NI managed certificate configuration via ni-tls-config. The work includes:

  1. TLS loader enhancements
    Refactors TlsConfigLoader to use ni-tls-config contents APIs instead of direct file-path parsing, enabling directory:// support for trusted certificate bundles.

  2. TLS configuration templates with explicit role naming
    Introduces role-explicit template source names so usage is clear at the source level:

    • ni-grpc-device.server.conf.yml
    • ni-grpc-device.server.caps.yml
    • ni-grpc-device.client.defaults.yml
    • ni-grpc-device.client.caps.yml
  3. Canonical runtime filename mapping during staging
    Preserves canonical ni-tls-config runtime filenames during staging so runtime behavior stays compatible:

    • server source templates stage/copy to ni-grpc-device.conf.yml and ni-grpc-device.caps.yml
    • client source templates stage to ni-grpc-device.defaults.yml and ni-grpc-device.caps.yml
  4. Client artifact staging cleanup
    Updates client staging to use client.d as the staging folder (instead of config) for ni-tls client artifacts, improving clarity and resolving reviewer feedback around naming intent.

  5. Example configuration and feature gating
    Adds server_nitlsconfig.json to demonstrate secure configuration with:

    • "security": "ni-tls-config"
    • "feature_toggles": { "ni-tls-config": true }
  6. CI/artifact updates
    Updates workflow artifact packaging and staging logic so the new template naming model and canonical output mapping are included consistently.

  7. URI scheme normalization
    Standardizes URI schemes to lowercase file:// and directory:// for consistency.

Why should this Pull Request be merged?

This change improves TLS security support while reducing naming ambiguity for maintainers. It keeps runtime compatibility by preserving canonical ni-tls-config filenames, but makes source ownership and intent explicit with server/client template naming. It also aligns artifact layout with clearer client.d staging semantics and addresses reviewer concern about confusing export naming behavior.

What testing has been done?

  • TLS loader builds and unit tests pass with the contents API integration.
  • End-to-end mutual TLS handshake validated on Windows host and NI Linux RT target.
  • Server correctly loads trusted certificates via directory://.
  • Client and server certificate exchange flow validated using automation.
  • Workflow and staging logic validated for template inclusion and canonical filename outputs.
  • URI normalization validated with lowercase file:// and directory:// schemes.
  • YAML template syntax validated.

…efault TLS

- add new server config example for ni-tls-config with feature toggle enabled
- remove obsolete server_tls.json and switch packaging references to server_nitlsconfig.json
- update shipped server/client TLS YAML templates to align with configure-tls flow
- keep shipping defaults TLS-disabled while preserving all configurable TLS fields
- add customer-facing inline comments to config and caps files for manual editing
- add dedicated client caps template and stage it as ni-grpc-device.caps.yml in client artifacts
- normalize URI scheme usage to lowercase file:// and directory:// across templates and script content
@texasaggie97 texasaggie97 changed the title [NOT READY FOR REVIEW] Updates for new ni-tls-config functionality Support ni-tls-config Directory Scheme and Add TLS Configuration Templates May 2, 2026
Comment thread source/codegen/stage_client_files.py
…nonicalize staging outputs

- Rename source config templates to include server/client context
- Stage client templates into client.d instead of config
- Preserve canonical ni-tls-config output filenames during staging
- Update server CMake copy sources to renamed server templates
Comment thread source/config/server_nitlsconfig.json Outdated
Comment thread source/config/server_nitlsconfig.json
Copy link
Copy Markdown
Collaborator

@maxxboehme maxxboehme left a comment

Choose a reason for hiding this comment

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

With these new client and server configuration files. I think there should be a readme update clearing up their uses.

Comment thread source/config/server_nitlsconfig.json Outdated
Signed-off-by: Mark Silva <mark.silva@emerson.com>
Signed-off-by: Mark Silva <mark.silva@emerson.com>
@texasaggie97 texasaggie97 merged commit 6bfbfa5 into ni:main May 12, 2026
9 checks passed
@texasaggie97 texasaggie97 deleted the dev/texasaggie97/fix-ni-tls-config-trusted-directory branch May 12, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants