You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Not really sure where/if there is an actual bug, but the documentation seems
inaccurate);
Documentation
=============
func (c *Conn) tls.Handshake() os.Error
... ***Most uses of this package need not call Handshake explicitly: the first Read or
Write will call it automatically ***
One would then assume an http.ListenAndServeTLS, in accumulating the request, would have
forced a handshake to occur.
Instead, I've ended up needing to create a custom listener that forces a handshake in
order to establish PeerCert data in the ConnectionState attribute.
I'm not certain this is wrong from the standpoint of TLS phrasing, but the documentation
can lead a developer to be confused.
What steps will reproduce the problem?
1. Create a self-signed cert & key: openssl req -new -x509 -nodes -subj
"/CN=localhost" -out host.cert
2. Compile & run attached sample
3. curl --insecure https://localhost:8443
What is the expected output?
Handshake complete
What do you see instead?
Handshake incomplete
Which compiler are you using (5g, 6g, 8g, gccgo)?
8g
Which operating system are you using?
linux
Which revision are you using? (hg identify)
53460e066c2f+ tip
Please provide any additional information below.
I'm not convinced a code-change is needed, but someone who understands why the
documentation seems conflicting would do well to clarify it.
Sorry, just got a chance to look into this.
I can confirm the problem. It looks like the handshake does happen, but the http
package takes a snapshot of the TLS state from before the HTTP request is read (hence
before the handshake takes place).
I'll move it around and add a test.
Thanks for the great report!
by jdnurmi@qwe.cc:
Attachments:
The text was updated successfully, but these errors were encountered: