Hi,
Thanks. I found that I did not have NSS related files in my profile, hence SSL was disabled. I will try fixing that.
-- Abhijit
Darin Fisher wrote:
Hi, Can you capture a socket transport log? Here's how:
In Linux: $ export NSPR_LOG_MODULES=nsSocketTransport:5 $ export NSPR_LOG_FILE=/tmp/sock.log
In Windows: C:\> set NSPR_LOG_MODULES=nsSocketTransport:5 C:\> set NSPR_LOG_FILE=C:\sock.log
Then, try running your code, and inspect the log file. You should be able to determine from that log file where the NS_ERROR_FAILURE originated. Feel free to send me the log file, and I can interpret it for you.
Regards, -Darin
Abhijit wrote:
Hi,
I am writing a javascript XPCOM component, in which I want to open a client socket connection with a server that runs TLSv1 protocol.
After connecting to the server, I get an error when I check for data on the socket. Here is what I do:
const SocketService = Components.classes["@mozilla.org/network/socket-transport-service;1"]
.getService().QueryInterface(Components.interfaces.nsISocketTransportService);
var sock = SocketService. createTransport(["ssl"],1,"192.168.0.100", 1241,null); var InStream = socket.openInputStream(Components.interfaces.nsITransport.OPEN_BLOCKING,0,0);
var InputStream = Components.classes["@mozilla.org/binaryinputstream;1"] createInstance(Components.interfaces.nsIBinaryInputStream);
InputStream.setInputStream(InStream);
Now when I do:
InputStream.available();
I get the following error:
uncaught exception: [Exception... "Component returned failure code: 0x80004005(NS_ERROR_FAILURE) [nsIBinaryInputStream.available]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/mozilla/dist/bin/components/testComponent.js ::
_get_connection :: line 287" data: no]
I was wondering if there are some steps that I have missed i.e. after creating the socket if some SSL handshake operations are required.
I would appreciate it if someone can point out what is missing.
Thanks, -- Abhijit
_______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
_______________________________________________ Mozilla-xpcom mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-xpcom
