Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cafile support to the go-nethttp stub #231

Merged
merged 1 commit into from
Aug 25, 2016
Merged

Conversation

jviide
Copy link
Contributor

@jviide jviide commented Aug 16, 2016

stubs/go-nethttp/run.go didn't implement custom CA bundle support. This pull request does add the support, but gets somewhat weird results for badtls.io tests:

$ go version
go version go1.7 darwin/amd64

$ trytls https go run stubs/go-nethttp/run.go 
platform: OS X 10.11.6
runner: trytls 0.3.2 (CPython 2.7.12, OpenSSL 0.9.8zh)
stub: go run stubs/go-nethttp/run.go
...
 FAIL valid certificate Common Name [accept domain-match.badtls.io:10000]
      output: Get https://domain-match.badtls.io:10000: x509: certificate is valid for , not domain-match.badtls.io
 FAIL valid wildcard certificate Common Name [accept wildcard-match.badtls.io:10001]
      output: Get https://wildcard-match.badtls.io:10001: x509: certificate is valid for , not wildcard-match.badtls.io
 PASS support for Subject Alternative Name (SAN) [accept san-match.badtls.io:10002]
 FAIL TLS handshake with 1024 bit Diffie-Hellman (DH) [accept dh1024.badtls.io:10005]
      output: Get https://dh1024.badtls.io:10005: x509: certificate is valid for , not dh1024.badtls.io
 PASS certificate expired in year 1963 [reject expired-1963.badtls.io:11000]
      output: Get https://expired-1963.badtls.io:11000: x509: certificate has expired or is not yet valid
 PASS certificate validity starts in future [reject future.badtls.io:11001]
      output: Get https://future.badtls.io:11001: x509: certificate has expired or is not yet valid
...

Note the output for the failing tests. Here's the one for [accept domain-match.badtls.io:10000]:

Get https://domain-match.badtls.io:10000: x509: certificate is valid for , not domain-match.badtls.io

For comparison here's corresponding output for [reject san-mismatch.badtls.io:11003] test (which is a PASS):

Get https://san-mismatch.badtls.io:11003: x509: certificate is valid for san-match.badtls.io, not san-mismatch.badtls.io

Does someone happen to have any insight whether the problem lies in the run.go code or somewhere else?

@jviide
Copy link
Contributor Author

jviide commented Aug 16, 2016

Pinging @aleksiklasila, @oherrala and @ikisusi to ponder the mystery.

@Mamietti Mamietti modified the milestones: 0.3.0, 0.3.3, 0.4.0 Aug 17, 2016
@jviide
Copy link
Contributor Author

jviide commented Aug 22, 2016

@joneskoo graciously opened issue golang/go#16834 about the weird error message.

@jviide
Copy link
Contributor Author

jviide commented Aug 22, 2016

golang/go#16836 is related, too.

@jviide
Copy link
Contributor Author

jviide commented Aug 24, 2016

Rebased on top of master after #260.

@Mamietti Mamietti merged commit e653533 into master Aug 25, 2016
@jviide jviide deleted the golang-cafile-support branch August 25, 2016 11:17
@jviide jviide modified the milestones: 0.4.0, 0.3.4 Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants