Skip to content

Pin client TLS certificate#332

Open
TurboTheTurtle wants to merge 1 commit into
shadowsocks:masterfrom
TurboTheTurtle:fix-client-cert-pinning
Open

Pin client TLS certificate#332
TurboTheTurtle wants to merge 1 commit into
shadowsocks:masterfrom
TurboTheTurtle:fix-client-cert-pinning

Conversation

@TurboTheTurtle
Copy link
Copy Markdown

Summary

  • make client-side cert / certRaw usable as a pinned peer certificate chain
  • enable V2Ray's pinned-certificate verification path when a client certificate is provided
  • add coverage for the PEM certificate-chain hash helper

Why

In client TLS mode, the provided certificate was only passed as an authority certificate. That is platform-dependent and does not handle the common case where users provide the server certificate itself rather than a CA. V2Ray already supports fail-closed peer certificate-chain pinning, so this maps cert / certRaw to that mechanism.

Closes #330

Validation

  • /opt/homebrew/bin/gofmt -w main.go main_test.go
  • /opt/homebrew/bin/go test ./...
  • /opt/homebrew/bin/go build ./...
  • git diff --check

Please preserve author attribution if this PR is squashed or reworked:
Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.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.

Certificate parameter is unused in client mode

1 participant