Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Make sure to print certificaes
  • Loading branch information
maraino committed Apr 23, 2025
commit ee00ba33ab08b6d22d84d6d30a0b47789dc2e9a1
7 changes: 7 additions & 0 deletions command/tls/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"crypto/tls"
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"net"
"reflect"
Expand Down Expand Up @@ -164,6 +165,9 @@

// Print only the list of verified chains
if printChains {
if len(cs.VerifiedChains) == 0 {
return errors.New("failed to build a chain of verified certificates")
}
for _, chain := range cs.VerifiedChains {
for _, crt := range chain {
fmt.Print(string(pem.EncodeToMemory(&pem.Block{
Expand All @@ -177,6 +181,9 @@

// Print only the peer certificates
if printPeer {
if len(cs.PeerCertificates) == 0 {
return errors.New("peer did not sent a certificate")
}
for _, crt := range cs.PeerCertificates {
fmt.Print(string(pem.EncodeToMemory(&pem.Block{
Type: "CERTIFICATE", Bytes: crt.Raw,
Expand Down Expand Up @@ -223,7 +230,7 @@
return "P-521"
case tls.X25519:
return "X25519"
case tls.X25519MLKEM768:

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

undefined: tls.X25519MLKEM768 (typecheck)

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / lint / lint

undefined: tls.X25519MLKEM768) (typecheck)

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / test / test (oldstable)

undefined: tls.X25519MLKEM768

Check failure on line 233 in command/tls/handshake.go

View workflow job for this annotation

GitHub Actions / ci / build / build (oldstable)

undefined: tls.X25519MLKEM768
return "X25519MLKEM768"
default:
return "Unknown"
Expand Down
Loading