Skip to content

Support boringssl SSLCredential API#935

Merged
normanmaurer merged 34 commits intonetty:mainfrom
jmcrawford45:sslcredential
Aug 15, 2025
Merged

Support boringssl SSLCredential API#935
normanmaurer merged 34 commits intonetty:mainfrom
jmcrawford45:sslcredential

Conversation

@jmcrawford45
Copy link
Copy Markdown
Contributor

Motivation:

Historically, BoringSSL lacked a built-in method to select between RSA and ECDSA certificates. The selection process, especially at TLS 1.2, is quite complex, as detailed in this link. TLS 1.3 simplifies this process significantly. Additionally, within ECDSA, there are different curves to consider, and future developments will introduce post-quantum key types. Recently, the SSL Credential API was introduced to BoringSSL to address this and a variety of other certificate negotiation decisions, such as:

Different kinds of credentials (delegate credentials, raw public keys, external PSKs, and more future innovations.
Negotiation for trust anchors to aid in PQ transitions and PKI agility.

Modifications:

Add JNI bindings for all the existing SSL_Credential related functionality in BoringSSL.

Result:

The SSL_CREDENTIAL consolidates everything related to a single "credential" into an object. Credentials can vary in type, such as X.509 certificates or others. Each credential has criteria, based on TLS protocol rules, to determine its applicability to a connection. Users configure an ordered preference list of credentials, and BoringSSL selects the first matching one.

This approach can be used alongside application-specific selection logic, like SNI dispatch. End users would use their criteria to select a list of candidates, such as an ECDSA and RSA certificate for a host, configure them in preference order with BoringSSL, and BoringSSL will evaluate them according to protocol rules.

Implements #918

@jmcrawford45 jmcrawford45 marked this pull request as ready for review June 25, 2025 19:24
@argha-c
Copy link
Copy Markdown

argha-c commented Jun 26, 2025

@normanmaurer: If you could PTAL. Curious if you have a different design suggestion? This should pave the path for PQC support in netty-tcnative.

@normanmaurer normanmaurer requested a review from chrisvest June 27, 2025 14:34
Copy link
Copy Markdown
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

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

First round of review...

jmcrawford45 and others added 9 commits June 27, 2025 20:32
…edential.java

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…edential.java

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…edential.java

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
jmcrawford45 and others added 11 commits June 27, 2025 20:38
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
@jmcrawford45
Copy link
Copy Markdown
Contributor Author

@normanmaurer @chrisvest the first rounds of feedback should be addressed; I'm not sure if the centos6 build failure is related to my change.

@chrisvest
Copy link
Copy Markdown
Member

I think this looks good. Sorry it took a while to get back to reviewing it again.

@jmcrawford45
Copy link
Copy Markdown
Contributor Author

@chrisvest thank you for the review, I can look into integrating this once it merges. @normanmaurer the requested changes is still showing from the first round review, I'm not sure if that's blocking or not for this repo

@jmcrawford45
Copy link
Copy Markdown
Contributor Author

@normanmaurer would you be able to take another look this week?

@normanmaurer
Copy link
Copy Markdown
Member

@jmcrawford45 I am currently on PTO... will check once back

Copy link
Copy Markdown
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

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

LGTM... Thanks a lot!

@normanmaurer normanmaurer merged commit 2a47a58 into netty:main Aug 15, 2025
16 of 17 checks passed
@normanmaurer normanmaurer added this to the 2.0.73.Final milestone Aug 15, 2025
normanmaurer added a commit to netty/netty that referenced this pull request Feb 18, 2026
Motivation:

Historically, BoringSSL lacked a built-in method to select between RSA
and ECDSA certificates. The selection process, especially at TLS 1.2, is
quite complex, as detailed in [this
link](https://boringssl.googlesource.com/boringssl/+/5a3faaa2d50b2540c6973531841723f633f388cd/ssl/test/runner/runner.go#19669).
TLS 1.3 simplifies this process significantly. Additionally, within
ECDSA, there are different curves to consider, and future developments
will introduce post-quantum key types. The SSL Credential API was
introduced to BoringSSL to address this and a variety of other
certificate negotiation decisions, such as:

Different kinds of credentials ([delegate
credentials](https://www.rfc-editor.org/rfc/rfc9345.html), [raw public
keys](https://www.rfc-editor.org/rfc/rfc7250.html), [external
PSKs](https://www.rfc-editor.org/rfc/rfc9258.html), and more [future
innovations](https://davidben.github.io/merkle-tree-certs/draft-davidben-tls-merkle-tree-certs.html).
[Negotiation for trust
anchors](https://github.com/davidben/tls-trust-expressions/blob/main/explainer.md)
to aid in PQ transitions and PKI agility.

Modification:

Introduce high level APIs leveraging the most useful bindings introduced
in netty/netty-tcnative#935

```java
OpenSslCredential credential = OpenSslCredentialBuilder.newX509(privateKey, chain)
    .trustAnchorId(anchorId)
    .mustMatchIssuer(true)
    .build();
```

Result:

There are two main immediate use cases to this API
First, it is now possible to delegate all the complexity of EC/RSA
serving to BoringSSL.
```java
OpenSslCredential ecdsaCred = buildEcdsaCredential();

SslContext ctx = SslContextBuilder.forServer(rsaKey, rsaCert)
    .sslProvider(SslProvider.OPENSSL_REFCNT)
    .credential(ecdsaCred)
    .build();
```
This mechanism will also be useful to allow clients to negotiate trust
anchors via https://github.com/tlswg/tls-trust-anchor-ids. For example,
a modern client may request for a more efficient or more secure chain
while legacy clients can still receive the less secure / less efficient
fallback cert.


depends on netty/netty-tcnative#949

---------

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
netty-project-bot pushed a commit to netty/netty that referenced this pull request Feb 18, 2026
Motivation:

Historically, BoringSSL lacked a built-in method to select between RSA
and ECDSA certificates. The selection process, especially at TLS 1.2, is
quite complex, as detailed in [this
link](https://boringssl.googlesource.com/boringssl/+/5a3faaa2d50b2540c6973531841723f633f388cd/ssl/test/runner/runner.go#19669).
TLS 1.3 simplifies this process significantly. Additionally, within
ECDSA, there are different curves to consider, and future developments
will introduce post-quantum key types. The SSL Credential API was
introduced to BoringSSL to address this and a variety of other
certificate negotiation decisions, such as:

Different kinds of credentials ([delegate
credentials](https://www.rfc-editor.org/rfc/rfc9345.html), [raw public
keys](https://www.rfc-editor.org/rfc/rfc7250.html), [external
PSKs](https://www.rfc-editor.org/rfc/rfc9258.html), and more [future
innovations](https://davidben.github.io/merkle-tree-certs/draft-davidben-tls-merkle-tree-certs.html).
[Negotiation for trust
anchors](https://github.com/davidben/tls-trust-expressions/blob/main/explainer.md)
to aid in PQ transitions and PKI agility.

Modification:

Introduce high level APIs leveraging the most useful bindings introduced
in netty/netty-tcnative#935

```java
OpenSslCredential credential = OpenSslCredentialBuilder.newX509(privateKey, chain)
    .trustAnchorId(anchorId)
    .mustMatchIssuer(true)
    .build();
```

Result:

There are two main immediate use cases to this API
First, it is now possible to delegate all the complexity of EC/RSA
serving to BoringSSL.
```java
OpenSslCredential ecdsaCred = buildEcdsaCredential();

SslContext ctx = SslContextBuilder.forServer(rsaKey, rsaCert)
    .sslProvider(SslProvider.OPENSSL_REFCNT)
    .credential(ecdsaCred)
    .build();
```
This mechanism will also be useful to allow clients to negotiate trust
anchors via https://github.com/tlswg/tls-trust-anchor-ids. For example,
a modern client may request for a more efficient or more secure chain
while legacy clients can still receive the less secure / less efficient
fallback cert.

depends on netty/netty-tcnative#949

---------

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
(cherry picked from commit a40fb71)
normanmaurer added a commit to netty/netty that referenced this pull request Feb 19, 2026
Forward port of #15919 to 5.0
Cherry-picked commit: a40fb71

---
Motivation:

Historically, BoringSSL lacked a built-in method to select between RSA
and ECDSA certificates. The selection process, especially at TLS 1.2, is
quite complex, as detailed in [this
link](https://boringssl.googlesource.com/boringssl/+/5a3faaa2d50b2540c6973531841723f633f388cd/ssl/test/runner/runner.go#19669).
TLS 1.3 simplifies this process significantly. Additionally, within
ECDSA, there are different curves to consider, and future developments
will introduce post-quantum key types. The SSL Credential API was
introduced to BoringSSL to address this and a variety of other
certificate negotiation decisions, such as:

Different kinds of credentials ([delegate
credentials](https://www.rfc-editor.org/rfc/rfc9345.html), [raw public
keys](https://www.rfc-editor.org/rfc/rfc7250.html), [external
PSKs](https://www.rfc-editor.org/rfc/rfc9258.html), and more [future
innovations](https://davidben.github.io/merkle-tree-certs/draft-davidben-tls-merkle-tree-certs.html).
[Negotiation for trust
anchors](https://github.com/davidben/tls-trust-expressions/blob/main/explainer.md)
to aid in PQ transitions and PKI agility.

Modification:

Introduce high level APIs leveraging the most useful bindings introduced
in netty/netty-tcnative#935

```java
OpenSslCredential credential = OpenSslCredentialBuilder.newX509(privateKey, chain)
    .trustAnchorId(anchorId)
    .mustMatchIssuer(true)
    .build();
```

Result:

There are two main immediate use cases to this API
First, it is now possible to delegate all the complexity of EC/RSA
serving to BoringSSL.
```java
OpenSslCredential ecdsaCred = buildEcdsaCredential();

SslContext ctx = SslContextBuilder.forServer(rsaKey, rsaCert)
    .sslProvider(SslProvider.OPENSSL_REFCNT)
    .credential(ecdsaCred)
    .build();
```
This mechanism will also be useful to allow clients to negotiate trust
anchors via https://github.com/tlswg/tls-trust-anchor-ids. For example,
a modern client may request for a more efficient or more secure chain
while legacy clients can still receive the less secure / less efficient
fallback cert.


depends on netty/netty-tcnative#949

Co-authored-by: Jared Crawford <jmcrawford45@gmail.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
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.

4 participants