Skip to content

Permit to pass SslParameters to ExporterBuilders for fine grain TLS configuration #8558

Open

Description

@NilsRenaud

Problem

Post quantum resistant key exchange for TLS RFC is quite stable, enough for Java to implement it in JDK 27.
So when running the JDK OpenTelemetry exporter on java 27, it'll use a post-quantum-resistant algorithm as primary choice (X25519MLKEM768), and this can be defined at the entire JVM level with jdk.tls.namedGroups property.

The issue arise when we want to enforce OTLP to use only PQ-resistant algorithm (by setting jdk.tls.namedGroups=X25519MLKEM768 for example) while needing to call external services that does not offer yet a PQ-resistant key exchange algorithm.
Since the property affects the whole JVM other HttpClients will be impacted.

Proposed solution

Since HttpClient builder accepts javax.net.ssl.SSLParameters, I'd like to be able to pass an instance of these parameters alongside the SslContext in xxxExporterBuilder (such as OtlpHttpLogRecordExporterBuilder).
This way we could easily low level parameters of future TLS handshakes.

Alternatives/Workaround

Since one can currently pass an SslContext, it's possible to create a custom SslContext that will set SslParameters to the SslEngines it produces. But that's about 150 lines of boilerplate code...

Additional context

PostQuantum resistance is a hot topic right now, lots of countries have set deadlines for critical software to become PQ-resistant.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Activity

  1. cfcromn commented on Jul 7, 2026

    @cfcromn

    Hi maintainers, I’m interested in investigating this feature request.

    From the issue description, the goal seems to be allowing per-exporter TLS configuration by passing SSLParameters to OTLP HTTP exporter builders, instead of relying on JVM-wide properties such as jdk.tls.namedGroups.

    Before attempting an implementation, I’d like to confirm the preferred API direction:

    1. Should this be exposed as a new setSslParameters(SSLParameters sslParameters) method on the OTLP HTTP exporter builders?
    2. Should it apply consistently to trace, metric, and log record HTTP exporters?
    3. Should the behavior be limited to the JDK HttpClient sender, or should OkHttp-based senders also support it where possible?
    4. When both sslContext(...) and sslParameters(...) are configured, should the builder pass both to the underlying HTTP client?
    5. Since SSLParameters is mutable, should the builder defensively copy it when it is provided?

    If this direction sounds reasonable, I’d be happy to prepare a focused PR with tests covering propagation of the configured SSLParameters.

  2. jack-berg commented on Jul 24, 2026

    @jack-berg
    Member

    I've been investigating this as part of #8610, which solves the problem of configuring which TLS protocols should be. TLS protocols also shows up in SSLParameters, and so I considered whether a generic setSslParameter(SSLParameters) might be the preferred API design. My opinion is no. SSLParameters is a bag of many SSL/TLS parameters, many of which we don't support, and some of which its not clear if we could even support across our suite of senders.

    Instead, I think that we gradually add the configuration options we need, some of which are part of SSLParameters, as standalone setters.

    In this case, I think we could more simply add setEnabledCipherSuites(List<String>) to accommodate this use case.

  3. raheelshahzad commented on Sep 24, 2026

    @raheelshahzad

    I'd like to pick up the standalone setter approach described above. Plan:

    • Add setEnabledCipherSuites(List<String>) to the OTLP HTTP and gRPC exporter builders (traces, metrics, logs, profiles), mirroring the structure of setEnabledProtocols from Add setEnabledProtocols option to OTLP exporter builders #8610.
    • Plumb it through HttpSenderConfig / GrpcSenderConfig to the JDK sender (SSLParameters.setCipherSuites) and the OkHttp senders (ConnectionSpec.Builder.cipherSuites). The upstream gRPC managed-channel sender is left alone, same as for protocols.
    • Cipher suite names follow the JSSE convention, e.g. TLS_AES_128_GCM_SHA256.

    Unless there's an objection I'll open a PR in the next few days.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestSuggest an idea for this project

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions