Skip to content

Commit 319683b

Browse files
authored
Add enough tls.ConnectionState and tls.CipherSuiteName() to compile fortio/log (#4345)
src/crypt: add enough tls.ConnectionState and tls.CipherSuiteName() to compile fortio/log
1 parent 4af3f61 commit 319683b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/crypto/tls/common.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"context"
1111
"crypto"
1212
"crypto/x509"
13+
"fmt"
1314
"io"
1415
"net"
1516
"sync"
@@ -23,9 +24,21 @@ import (
2324
// only supports Elliptic Curve based groups. See RFC 8446, Section 4.2.7.
2425
type CurveID uint16
2526

27+
// CipherSuiteName returns the standard name for the passed cipher suite ID
28+
//
29+
// Not Implemented.
30+
func CipherSuiteName(id uint16) string {
31+
return fmt.Sprintf("0x%04X", id)
32+
}
33+
2634
// ConnectionState records basic TLS details about the connection.
2735
type ConnectionState struct {
2836
// TINYGO: empty; TLS connection offloaded to device
37+
//
38+
// Minimum (empty) fields for fortio.org/log http logging and others
39+
// to compile and run.
40+
PeerCertificates []*x509.Certificate
41+
CipherSuite uint16
2942
}
3043

3144
// ClientAuthType declares the policy the server will follow for

0 commit comments

Comments
 (0)