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

crypto/tls: connection read no data without error from server side #5300

Closed
gopherbot opened this issue Apr 17, 2013 · 3 comments
Closed

crypto/tls: connection read no data without error from server side #5300

gopherbot opened this issue Apr 17, 2013 · 3 comments

Comments

@gopherbot
Copy link

by xofyarg:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. start a tls server[1] writing in go with tls pkg
2. connect the server using a client built with openssl
3. send something to server

What is the expected output?
client's data is received or error occured.

What do you see instead?
Server got two read event. The former returns no data or error. The latter gets the data
that client sent before.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
OSX Lion/Linux-2.6.32/Linux-3.0

Which version are you using?  (run 'go version')
go1.0.3 and go1.1beta2

Please provide any additional information below.
[1] go server: http://play.golang.org/p/N_d4hjcRft

[2] commands to generate server key pair:
  openssl genrsa 1024 > srv.key
  openssl req -new -x509 -nodes -sha1 -days 365 -key srv.key > srv.cer

[3] client:
  openssl: $ echo -n "hello" | openssl s_client -connect 127.0.0.1:8080 -tls1
  python: 
    import socket
    import ssl
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect(('localhost', 8080))
    ss = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1)
    ss.write('hello')
    ss.close()
@davecheney
Copy link
Contributor

Comment 1:

I believe this is a duplicate of issue #5309.
After some discussion it was determined that Read can return 0, nil and this is not an
error. Further diagnosis on issue #5309 showed that certain ciphers would cause this to
happen as a side effect of the BEAST mitigation.

Status changed to Duplicate.

Merged into issue #5309.

@gopherbot
Copy link
Author

Comment 2 by xofyarg:

Thank you.
So what's the suggest action to this problem? Should I enclose the read within a loop?
Or tls package will make some changes to follow the normal read behavior?

@davecheney
Copy link
Contributor

Comment 3:

issue #5309 remains open, and appears to be related to the cipher negotiated. I suggest
continuing the discussion on that issue.

@mikioh mikioh changed the title tls connection read no data without error from server side crypto/tls: connection read no data without error from server side Jan 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants