-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add secure method to tcp socket for firefox #12
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ describe("sockets", function() { | |
serverSocket.disconnect(); | ||
done(); | ||
}; | ||
clientSocket.connect("localhost", 8081); | ||
clientSocket.connect("localhost", 8081, false); | ||
}); | ||
|
||
it("receives data", function(done) { | ||
|
@@ -24,7 +24,7 @@ describe("sockets", function() { | |
done(); | ||
}); | ||
}; | ||
clientSocket.connect("localhost", 8081); | ||
clientSocket.connect("localhost", 8081, false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test of secure behavior would be fantastic, so we can make sure this doesn't break with future changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, unfortunately the tests are already failing with 1 failure, and I add a test that I intentionally try to make fail, it still says only 1 failure. I'm trying to test by running "grunt build_test", then going to build/test and running "cfx run". Is there some other way I should be testing in Firefox? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just figured out how to get tests running (tcp_socket.spec.js had been missing from test/lib/main.js) |
||
clientSocket.write(str2ab(stringMessage)); | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this continue the existing TCP session, or start a new one? It looks like it makes a new connection to the host/port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It continues the existing TCP session. The firefox API is weird and unlike in Chrome you don't get a unique socket identifier which you can upgrade to TLS, nor is there a socket object with any upgradeToTls method. Instead it appears to keep a mapping from hostname/port to a socket which can be upgraded to tls by creating a new nsISocketTransport object (not necessarily the same as creating a new connection) with type 'starttls'.
We will need to test this in the future and make sure it doesn't result in weird race conditions if we have 2 pieces of code both trying to connect to the same hostname/port and do a starttls flow (e.g. if there are 2 instances of a GTalk social provider that are both trying to connect to GTalk at the same time with different logins)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems worth a comment.
On Tue, Aug 12, 2014 at 8:51 AM, dborkan notifications@github.com wrote: