Hi,

I'd like to ask if there is some possibility to use nsServerSocket as
an ssl connection accepting server or if there is some other support
for ssl server in necko.

I found $\mozilla\security\nss\cmd\SSLsample\server.c sample but
transform it to nsIServerSocket implmentation seems to be very
dificault maybe impossible. I have been tring to write this
implementation in this way:

in moment I get an ssl socket in handle_connection() function (result
of setupSSLSocket() function call) I apply to it a piece of code from
existing nsServerSocket impl:

        nsRefPtr<nsSocketTransport> trans = new nsSocketTransport;
        if (!trans)
        {
                mCondition = NS_ERROR_OUT_OF_MEMORY;
                goto cleanup;
        }

        nsresult rv = trans->InitWithConnectedSocket(clientFD, &clientAddr);
        if (NS_FAILED(rv))
        {
                mCondition = rv;
                goto cleanup;
        }


and then pass "trans" as an argument to OnSocketAccepted callback. This
is not absolutly tested and I'm not sure this the right way. What more
my condition it to use only mozilla SDK - so I have no access to
nsSocketTransport.

So is there any other way or suggestion?

Thank you very much.

-hb-

_______________________________________________
Mozilla-netlib mailing list
Mozilla-netlib@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to