-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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
VM env req.protocol is inaccurate #1863
Comments
can you send us the entire request header? |
Sure, I should have included this first....
Here is the results from an
|
hmm not sure. can't really see anything in that request. it doesn't look like you're using a proxy, so we can rule that out. it's also kind of out of the scope of express since there's so much more going on. can you ask this question on stack overflow? |
I think we may need to revisit the check for whether a connection is encrypted: https://github.com/visionmedia/express/blob/master/lib/request.js#L351 Can't say I am able to find anywhere in the node docs that indicate that is public api or even a thing anymore... |
Yeah no proxy is involved, the following is in the request: _parsedUrl:
{ protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: null,
query: null,
pathname: '/',
path: '/',
href: '/' } Perhaps it is a connect issue as this is the module express is relying on
|
|
I am running |
I don't think req.connection.encrypted is a thing anymore.. until I find out otherwise. |
@defunctzombie |
@dougwilson awesome! @jas- we don't support unstable node yet :) |
Issue #1864 will track the issue for node 0.12 |
Thanks! You perhaps have a good work around? |
@jas- yes, use node 0.10 or serve behind a proxy like nginx |
@jas anything else may cause weird issues, because the development versions of node.js change things around all the time, which can cause subtle issues in applications not tested against them (like connect/express). Of course you can always monkey patch your stuff to work, but you'll either need to figure out some property in |
@dougwilson Yeah I was just looking at some additional properties within the |
this is why hiding node's internals is a great idea haha. will have to update that for koa too |
I checked koa, it uses socket.encrypted. Neither is documented though, so I have no freaking idea what's going on |
@visionmedia @jonathanong The above is a complete Perhaps @trevnorris or @IsacS might have some more information as I couldn't find anything in the changelog but perhaps the |
@jas- there is no mention of this in the changelog because it is not a public API. The commit that changed it is nodejs/node-v0.x-archive@af80e7b |
@dougwilson That was recent, I remember when that went in. Thanks. |
we should definitely request something public if there is nothing reliable |
Please do. If you find holes in the API that can't be implemented in user |
@trevnorris i opened up nodejs/node-v0.x-archive#6735 |
cool thanks @trevnorris |
It seems that http/https cannot be recognized now. The default is https?
|
When running the node.js HTTPS module using express the
req.protocol
is reportinghttp
when it should be reportinghttps
Environment information:
Host:
Ubuntu Linux jas-laptop 3.2.0-57-generic #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
VM s/w:
QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard
VM Guest:
CentOS Linux node.dev 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Relevant source; app.js & server.js.
I verified that the connection between the host & guest are indeed using SSL with the following
tcpdump
commands:Guest:
tcpdump -ieth0 -s 1024 -l -A tcp port 3000
Results:
E..^I...@... ... .......!..._.. ..@h..w...+.....~..mQ_+;..B.^...............K.vm.+.O...ic.|w.+.:.tL..A..X{.o>.....9..#.x{E...D..jUZu...Q$.....uND..C....[. ..G.E....9.. .I'..5..*M6.9.t@.....v...0...(.}.........a4..PsKtb.e?.=. .......u..r._.e;.sGQ.VXq.>..;p...q.#B.....C.1......i.8......1Q...P;3...M....6klik.L../..FO.kRu(..#.iA...XC..].F..in.3..pT.l......-J.8.F.>'t.6..e.........$.v$.g. '...f$<.b..pe#HE.1w...7'...v..jam...cOR........
..KGgb( W....e.t........7.%.._..a.........-..G.m.k...7lu.O.".F....V.u...... ..10:38:40.634548 IP 10.0.2.15.hbci > 10.0.2.2.59080: Flags [P.], seq 2488:2780, ack 5311, win 25470, length 292`
Host:
tcpdump -ilo -s 1024 -l -A host node.dev and tcp port 3000
Results:
E..j..@.@.Uy..............%.7=......._..... ..@h..w...+.....~..mQ_+;..B.^...............K.vm.+.O...ic.|w.+.:.tL..A..X{.o>.....9..#.x{E...D..jUZu...Q$.....uND..C....[. ..G.E....9.. .I'..5..*M6.9.t@.....v...0...(.}.........a4..PsKtb.e?.=. .......u..r._.e;.sGQ.VXq.>..;p...q.#B.....C.1......i.8......1Q...P;3...M....6klik.L../..FO.kRu(..#.iA...XC..].F..in.3..pT.l......-J.8.F.>'t.6..e.........$.v$.g. '...f$<.b..pe#HE.1w...7'...v..jam...cOR........
..KGgb( W....e.t........7.%.._..a.........-..G.m.k...7lu.O.".F....V.u...... ..10:38:38.444436 IP jas-laptop.3000 > localhost.59080: Flags [P.], seq 2488:2780, ack 5311, win 256, options [nop,nop,TS val 1898456 ecr 1898455], length 292`
However, when using the
req.protocol
it returnshttp
when the expected output should behttps
per the documentationThe text was updated successfully, but these errors were encountered: