Use OpenSSL with -sigalgs option to obtain server's certificate#3020
Merged
drwetter merged 1 commit intotestssl:3.3devfrom Apr 13, 2026
Merged
Use OpenSSL with -sigalgs option to obtain server's certificate#3020drwetter merged 1 commit intotestssl:3.3devfrom
drwetter merged 1 commit intotestssl:3.3devfrom
Conversation
When $OPENSSL s_client supports the "-sigalgs" option, get_server_certificate() uses $OPENSSL rather than tls_sockets() to obtain the server's certificate, but only for certificates with RSA and ECDSA public keys. With OpenSSL 3.5 and newer the list command can be used to get a list of supported TLS signature algorithms. With this commit, if OpenSSL 3.5 or newer is being used, the list of supported TLS signature algorithms is obtained and get_server_certificate() uses $OPENSSL s_client rather than tls_sockets() whenever $OPENSSL supports the relevant signature scheme. In addition to making the code a bit faster, this may be helpful if a server has a certificate with an SM2 public key and it only supports curveSM2 for key exchange, since tls_sockets() can not decrypt server responses if curveSM2 is used.
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
When
$OPENSSL s_clientsupports the "-sigalgs" option,get_server_certificate()uses $OPENSSL rather thantls_sockets()to obtain the server's certificate, but only for certificates with RSA and ECDSA public keys.With OpenSSL 3.5 and newer the
listcommand can be used to get a list of supported TLS signature algorithms.With this PR, if OpenSSL 3.5 or newer is being used, the list of supported TLS signature algorithms is obtained and
get_server_certificate()uses$OPENSSL s_clientrather thantls_sockets()whenever $OPENSSL supports the relevant signature scheme.In addition to making the code a bit faster, this may be helpful if a server has a certificate with an SM2 public key and it only supports curveSM2 for key exchange, since
tls_sockets()can not decrypt server responses if curveSM2 is used.What is your pull request about?
If it's a code change please check the boxes which are applicable
help()