Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Unexpected end of stream #21

Closed
fdematos opened this issue Jan 7, 2014 · 6 comments
Closed

Unexpected end of stream #21

fdematos opened this issue Jan 7, 2014 · 6 comments

Comments

@fdematos
Copy link

fdematos commented Jan 7, 2014

Hi,

First I want to thanks you for providing this library.

Our server is setup to use SPDY but anytime I try to call a webservice, I got an error.

Logs are :

SPDY [WARNING] loaded DEBUG build of SPDY framework
SPDY [INFO] register origin: <SPDYOrigin: 0xc488c70>
SPDY [DEBUG] origin registered: <SPDYOrigin: 0xc488c70>
SPDY [INFO] start loading https://XXXXXXXX/sts/SecurityTokenService/UT
SPDY [INFO] session connecting to <SPDYOrigin: 0xc7b1910>
SPDY [DEBUG] session using TLS
SPDY [DEBUG] sent client SETTINGS
SPDY [DEBUG] sent WINDOW_UPDATE.0 (+10420224)
SPDY [DEBUG] sent SYN_STREAM.1
SPDY [DEBUG] sent DATA.1! (1161)
SPDY [DEBUG] socket connected to XXXXXXX
SPDY [DEBUG] socket read0
SPDY [DEBUG] received DATA.1013478509 (165)
SPDY [DEBUG] sent RST_STREAM.1013478509
SPDY [DEBUG] socket scheduling read1
SPDY [WARNING] session connection error: Error Domain=SPDYSocketErrorDomain Code=6 "Unexpected end of stream." UserInfo=0xc79eb40 {NSLocalizedDescription=Unexpected end of stream.}
SPDY [INFO] session connection closed
SPDY [INFO] stop loading https://XXXXXXXX/sts/SecurityTokenService/UT

Do you have any idea of the reason or causes of this problem.

Thanks in advance.

@fdematos fdematos closed this as completed Jan 7, 2014
@fdematos fdematos reopened this Jan 7, 2014
@goaway
Copy link
Collaborator

goaway commented Jan 7, 2014

Based on the logs it looks like you immediately received a data frame for stream id 1013478509 on connection, which is odd since you've only just opened a stream with id 1. Seems like there could be a server-side bug? Can you share any details about your server implementation?

@IngmarStein
Copy link

Same here. I'm using NGINX 1.5.10 with http_spdy_module which supports SPDY/3.1 and http://spdycheck.org agrees on that:

Success! SPDY is Enabled!
Hurray, this website is using SPDY! The following protocols are supported:
spdy/3.1
http/1.1

I've enabled SPDY on the same socket as normal HTTPS traffic:

server {
        listen 443 ssl spdy;
}

Here's my log for a few parallel requests:

SPDY [WARNING] loaded DEBUG build of SPDY framework
SPDY [INFO] register origin: <SPDYOrigin: 0x10c635b40>
SPDY [DEBUG] origin registered: <SPDYOrigin: 0x10c635b40>
SPDY [INFO] start loading https://…
SPDY [INFO] session connecting to <SPDYOrigin: 0x10e469660>
SPDY [DEBUG] session using TLS
SPDY [DEBUG] sent client SETTINGS
SPDY [DEBUG] sent WINDOW_UPDATE.0 (+10420224)
SPDY [DEBUG] sent SYN_STREAM.1!
SPDY [INFO] start loading https://…
SPDY [DEBUG] sent SYN_STREAM.3!
SPDY [INFO] start loading https://…
SPDY [DEBUG] sent SYN_STREAM.5!
SPDY [INFO] start loading https://…
SPDY [DEBUG] sent SYN_STREAM.7!
SPDY [INFO] start loading https://…
SPDY [DEBUG] sent SYN_STREAM.9!
SPDY [DEBUG] socket read[0] (325)
SPDY [DEBUG] received DATA.1213486160 (317)
SPDY [DEBUG] sent RST_STREAM.1213486160
SPDY [DEBUG] socket scheduling read[1] (0:0)
SPDY [WARNING] session connection error: Error Domain=SPDYSocketErrorDomain Code=6 "Unexpected end of stream." UserInfo=0x111f404b0 {NSLocalizedDescription=Unexpected end of stream.}

@IngmarStein
Copy link

fdematos, I assume that you use a similar setup. I guess this is related to the fact that Secure Transport does not support NPN (as of iOS 7) and we're trying to use the same port for SPDY and standard HTTPS…

@goaway
Copy link
Collaborator

goaway commented Apr 2, 2014

If you are stuck using a single port, CocoaSPDY (and most other implementations) are guaranteed to send a SETTINGS frame first (or at least after SSL is established). This can be distinguished on the server from a normal HTTP request from as little as the first byte, if you can defer the rest of your pipeline setup until it's readable.

@shiqiang124
Copy link

@fdematos @goaway

ngnix 1.6.0

server{
      #dedicated port for iOS aka CocoaSPDY
      listen 4443 spdy
      listen 443 ssl spdy default_server


}

my cert is self-sign,so i add the follow code, make CFNetwork trust certs:


       SPDYConfiguration *configuration = [SPDYConfiguration defaultConfiguration];
       NSMutableDictionary *tlsSettings = [NSMutableDictionary dictionary];
       [tlsSettings setObject:(NSString *)kCFBooleanFalse forKey:(NSString *)kCFStreamSSLValidatesCertificateChain];
       [configuration setValue:tlsSettings forKey:@"tlsSettings"];

       [SPDYURLConnectionProtocol setConfiguration:configuration];

but then occur error like @fdematos Unexpected end of stream, do you resolve this problem ?

spdytest[9474:4d07] SPDY [INFO] start loading https://api.spdytest.com:4443/v1.1/xxx
spdytest[9474:4d07] SPDY [DEBUG] using standard session pool
spdytest[9474:4d07] SPDY [INFO] session connecting to <SPDYOrigin: https://api.spdytest.com:4443>
spdytest[9474:4d07] SPDY [DEBUG] session using TLS
spdytest[9474:4d07] SPDY [DEBUG] sent client SETTINGS
spdytest[9474:4d07] SPDY [DEBUG] sent WINDOW_UPDATE.0 (+10420224)
spdytest[9474:4d07] SPDY [DEBUG] Retrieving session: <SPDYSession: 0x1e67dda0>
spdytest[9474:4d07] SPDY [DEBUG] sent SYN_STREAM.1!
spdytest[9474:4d07] SPDY [DEBUG] socket connected to 10.120.151.197:4443
spdytest[9474:4d07] SPDY [DEBUG] socket read[0] (496)
spdytest[9474:4d07] SPDY [DEBUG] received DATA.1213486160 (488)
spdytest[9474:4d07] SPDY [DEBUG] sent RST_STREAM.1213486160
spdytest[9474:4d07] SPDY [DEBUG] socket scheduling read[1] (0:0)
spdytest[9474:4d07] SPDY [WARNING] session connection error: Error Domain=SPDYSocketErrorDomain Code=6 "Unexpected end of stream." UserInfo=0x1e70cd30 {NSLocalizedDescription=Unexpected end of stream.}
spdytest[9474:4d07] SPDY [INFO] session connection closed
spdytest[9474:4d07] SPDY [DEBUG] Removing session: <SPDYSession: 0x1e67dda0>
spdytest[9474:4d07] SPDY [DEBUG] using standard session pool
spdytest[9474:90b] networkerror:Error Domain=SPDYSocketErrorDomain Code=6 "Unexpected end of stream." UserInfo=0x1e70f5f0 {NSErrorFailingURLKey=https://api.spdytest.com:4443/v1.1/xxx, NSErrorFailingURLStringKey=https://api.spdytest.com:4443/v1.1/xxx, NSLocalizedDescription=Unexpected end of stream.}
spdytest[9474:4d07] SPDY [INFO] stop loading https://api.spdytest.com:4443/v1.1/xxx

@RomanTruba
Copy link

I have just same issue. Is it client or server side issue?
Is it possible to debug?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants