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

hpkp Dialer compatability with HTTP2 #14

Open
ghost opened this issue Jul 15, 2017 · 0 comments
Open

hpkp Dialer compatability with HTTP2 #14

ghost opened this issue Jul 15, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 15, 2017

Trying to use your dialer against http2.Transport seems to fail
Looks like http2.Transport.DialTLS expects

type Transport struct {
...
DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error)

See: https://github.com/golang/net/blob/master/http2/transport.go

Where your DialTLS doesn't accept a tls.Config

https://github.com/tam7t/hpkp/blob/master/dialer.go

My Error:

./https.go:63: cannot use hpkpDialConf.NewDialer() (type func(string, string) (net.Conn, error)) as type func(string, string, *tls.Config) (net.Conn, error) in assignment

Code is here:
https://github.com/GinoM/dingo/tree/hpkp-pinning

Your code works fine against http.Transport though.

I feel like there is probably a better solution but maybe you can add something like

func (c *DialerConfig) NewDialer2() func(network, addr string, cfg *tls.Config) (net.Conn, error) {
        c.TLSConfig = cfg
	reporter := c.Reporter
	if reporter == nil {
		reporter = emptyReporter
	}

	return newPinDialer(c.Storage, reporter, c.PinOnly, c.TLSConfig)
}```
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

No branches or pull requests

0 participants