Commit Graph
28 Commits
Author SHA1 Message Date
yuhan6665 b9bfba03b7 crypto/tls: improve client auth failure alerts
This change makes it easier for clients to debug mutual TLS connection failures. Currently, there are a few situations where invalid client auth leads to a generic "bad certificate" alert. 3 specific situations have a more appropriate TLS alert code, based on the alert descriptions in the appendix of both RFC5246 and RFC8446.
  1. The server is configured to require client auth, but no client cert was provided; the appropriate alert is "certificate required". This applies only to TLS 1.3, which first defined the certificate_required alert code.
  2. The client provided a cert that was signed by an authority that is not in the server's trusted set of CAs; the appropriate alert is "unknown certificate authority".
  3. The client provided an expired (or not yet valid) cert; the appropriate alert is "expired certificate".
Otherwise, we still fall back to "bad certificate".

Fixes #52113

Change-Id: I7d5860fe911cad8a1615f16bfe488a37e936dc36
GitHub-Last-Rev: 34eeab5
GitHub-Pull-Request: #53251
Reviewed-on: https://go-review.googlesource.com/c/go/+/410496
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2023-11-12 12:08:30 -05:00
yuhan6665 d3f9ac0cd1 Fix compile errors 2023-11-12 12:08:30 -05:00
RPRX 870716f6af Sync upstream Go 1.20
Excluding `boring` or test files
2023-11-12 12:08:30 -05:00
yuhan6665andRPRX da6c695a34 Add English translation
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
2023-10-09 20:30:20 -04:00
RPRX e426190d57 Allow fragmented REALITY Client Hello & Simplify logic
It's mainly for defending against certain attacks.
2023-08-28 17:12:59 +00:00
HellojackandRPRX e07c3b04b9 REALITY protocol: Add ChaCha20-Poly1305 auth mode (#4)
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
2023-06-13 07:58:28 +00:00
RPRX 176a94313e REALITY protocol: Set the fourth byte as reserved 2023-03-31 22:31:27 +00:00
RPRX d3d37610da Allow Client Hello with other data attached & Simplify logic 2023-03-31 19:11:18 +00:00
RPRX 442d33ede9 Do not show ciphertext SessionID or full AuthKey 2023-03-20 15:37:27 +00:00
RPRX 0d0713b108 Replace bytes.Clone() with append() 2023-03-09 12:52:56 +00:00
RPRX a7ae8b57f1 Apply target's time-out to hs.readClientFinished() 2023-03-09 20:51:17 +08:00
RPRX 6288e760a9 Reuse buf (though io.CopyBuffer() is not likely to actually use it) 2023-03-08 15:19:09 +00:00
RPRX dc9a7cef8e crypto/tls: set const maxUselessRecords to 32 (the same with OpenSSL)
https://github.com/golang/go/pull/58913
2023-03-07 15:20:57 +00:00
RPRX 15efa424b2 crypto/tls: reject change_cipher_spec record after handshake in TLS 1.3
https://github.com/golang/go/pull/58912
2023-03-07 15:19:08 +00:00
RPRX 6f8fa90c03 Generate template signedCert in advance 2023-03-06 07:23:16 +00:00
世界 f90825ddae Fix config clone (#3) 2023-02-28 11:51:37 +00:00
RPRX 524506d975 Add defer recover() to avoid potential panics 2023-02-27 19:29:02 +00:00
RPRX 9e83b0bee1 Make Accept() available 2023-02-27 15:02:28 +00:00
RPRX f34b4d1743 Use underlying for io.Copy() only 2023-02-26 07:26:56 +00:00
世界andRPRX 14f5d5380b Add DialContext (#1)
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
2023-02-26 06:43:27 +00:00
RPRX 8f76c23ba6 Add example 2023-02-19 12:35:07 +00:00
RPRX 085bdf2104 Refine the logic after Read(buf) 2023-02-17 10:27:04 +00:00
RPRX e814936a3d Use for i, t := range types instead
Much easier for other people to understand the code.
2023-02-10 13:50:08 +08:00
RPRX 5a9e6c0cc2 Show hs.c.conn == underlying instead
Most log points were added last month and are stable.
2023-02-09 21:39:09 +08:00
RPRX 02fa0dd5f6 Combine check and its for
They were seven different parts at the beginning. Finally, they become one.
2023-02-09 19:57:16 +08:00
RPRX 5e6719eaf3 REALITY is REALITY now
Thank @yuhan6665 for testing
2023-02-09 11:59:09 +08:00
RPRX fb7fc93023 Prepare for REALITY protocol 2023-01-29 14:32:27 +00:00
RPRX c3c05667a5 Package tls in Go 1.19.5
Excluding `boring` or test files
2023-01-29 14:31:01 +00:00