Comments (11)
The other thing you can try to do to debug this is to get a packet capture of the two different handshakes.
from swift-nio.
The websocket key (in Sec-Websocket-Key
) is set by the client, not the server. It's typically generated randomly, but the server has no influence over it: it can only compute over it. Is it the case that the client repeatedly connect to the Xcode-built server, but not the Bazel-built server? Does it always fail to connect to the Bazel server?
from swift-nio.
@Lukasa correct, the client is able to always connect to the server (macOS app) when the server is built with Xcode but handshake always fails when I build the server with Bazel
from swift-nio.
Does this reproduce with the sample servers in this repo?
from swift-nio.
I can give that a try and report back.
I did try to create a minimal server and client to share but that worked for both build systems (this was using a stripped down version of both the server and client).
The minimal server I built also worked with our large iOS client to establish a connection using both build systems, which I can only imagine means the issue is with the server and how it gets built/linked?
Is there anything I can enable to debug further? All I have to go off on is the error message I posted above.
The handshake failure comes right after calling resume
on a URLSessionWebSocketTask
on the iOS client.
from swift-nio.
@Lukasa thanks for your help here! I'm very much a newb here.
I haven't had a chance to get the exact web info yet but on the android client when it connects to the Bazel built server we do get some more info:
Throwable java.net.ProtocolException:
Expected 'Sec-WebSocket-Accept' header value 'eabW+NOBcvdzRVggc2z4oTgL8Og=' but was 'CBn5S5K8ShGNaOtKxZc7/ldcyno='
from swift-nio.
One of our engineers also determined the culprit seems to be from the hash of SHA1.swift differing between the two build systems.
Using CryptoKit we get the same SHA but using SHA1 from swift-nio these values differ for the same input.
Xcode:
Bazel:
Do you know of any build time flags, language standards and such that would change this behavior?
from swift-nio.
I've confirmed the root cause is BYTE_ORDER
is coming back as BIG_ENDIAN
which is incorrect for macOS arm64. Seems like a similar issue to: #2584
from swift-nio.
This minimal repo demonstrates the issue: https://github.com/luispadron/bazel-big-endian-on-macos
from swift-nio.
Can you confirm that you're using version 2.62.0? That contains the fix from #2584.
from swift-nio.
Confirmed that 2.62.0 fixes this issue for Bazel build. Thanks so much for your responsiveness here @Lukasa
from swift-nio.
Related Issues (20)
- Archiving fails in Swift 5.9, Xcode 15 beta HOT 19
- Sending/Receiving IP Packets Without Root Privilege HOT 6
- Trying to archive something that has swift-nio as dependency fails HOT 1
- subscript(canonicalForm:) should not split 'user-agent' on commas HOT 2
- TimeAmount.hours(.max) and probably others crash because of overflow HOT 2
- Needs Pods Support for latest 2.59.0 SwiftNIO version HOT 3
- NonBlockingFileIO has no async APIs HOT 5
- NIOLoopBound has bad error messages HOT 4
- More clearly document how child channels work
- Version 2.60.0 causing app to crash when launched on iOS 15.5 simulator HOT 26
- NIOConnectionErrors HOT 7
- TestFlight send failed Xcode 15.0 HOT 2
- `VsockAddressTest.testGetLocalCID` crashes in jammy with Swift 5.9.1 HOT 5
- Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions HOT 2
- NonBlockingFileIO.read(...) don't error if more than 4 GiB is requested HOT 4
- No such module NIO HOT 1
- Documentation: Missing docs for underscored protocols
- Hang risk. QoS HOT 2
- Deinited NIOAsyncWriter without calling finish() if socket connection failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-nio.