Skip to content

Operations endpoints: TLS support#946

Open
gengur wants to merge 3 commits into
hyperledger:mainfrom
gengur:operation_service_via_mTLS
Open

Operations endpoints: TLS support#946
gengur wants to merge 3 commits into
hyperledger:mainfrom
gengur:operation_service_via_mTLS

Conversation

@gengur

@gengur gengur commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

issue: #45

@gengur gengur requested a review from tock-ibm June 22, 2026 15:33
@gengur gengur force-pushed the operation_service_via_mTLS branch from 26d5a68 to 7b8da2f Compare June 22, 2026 15:34
gengur added 2 commits July 1, 2026 07:04
Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
@gengur gengur force-pushed the operation_service_via_mTLS branch 3 times, most recently from 0ef6d6a to e565aeb Compare July 2, 2026 10:09
@tock-ibm tock-ibm requested a review from Copilot July 2, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds TLS support for the operations HTTP endpoints (metrics/health) and wiring from local config into the operations system, plus unit coverage for the fabhttp TLS config builder.

Changes:

  • Extend the operations system to emit https:// URLs when operations TLS is enabled and to honor ops.TLS.Enabled when constructing the underlying fabhttp server.
  • Update node configuration extraction to pass operations TLS client-root CAs via ClientRootCAs.
  • Extend test utilities to allow fetching Prometheus metrics over TLS and add common/fabhttp TLS config unit tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
testutil/network_utils.go Adds optional TLS client configuration for Prometheus metrics fetch helper.
config/config.go Wires operations TLS client root CAs through extracted node configs.
common/operations/system.go Switches ops URLs to http/https based on operations TLS enablement; enables TLS on the ops server.
common/fabhttp/tls_test.go Adds unit tests for fabhttp.TLS.Config() behavior.

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

Comment thread config/config.go
Comment on lines +277 to 279
if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil {
config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ignored

Comment thread config/config.go
Comment on lines +351 to 353
if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil {
config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ignored

Comment thread config/config.go
Comment on lines +466 to 468
if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil {
config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ignored

Comment thread config/config.go
Comment on lines +546 to 548
if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil {
config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ignored

Comment thread testutil/network_utils.go
Comment on lines +67 to +72
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: tlsClientConfig,
},
Timeout: 10 * time.Second,
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed as suggested

Comment on lines +83 to +86
if system.options.TLS.Enabled {
return operationServiceURL("https://", "metrics", system.Addr(), logger)
}
return operationServiceURL("http://", "metrics", system.Addr(), logger)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will be implement further

Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
@gengur gengur force-pushed the operation_service_via_mTLS branch from e565aeb to 8223f6b Compare July 2, 2026 13:01
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.

2 participants