On Tue, Feb 26, 2008 at 3:09 PM,  <[EMAIL PROTECTED]> wrote:
> On Feb 15, 4:39 pm, "Wan-Teh Chang" <[EMAIL PROTECTED]> wrote:
>
> > On Fri, Feb 15, 2008 at 2:35 AM, D3||||!$ <[EMAIL PROTECTED]> wrote:
>  > > Hi All!!!
>  >
>  > >  I am looking for a standard NSS/NSPR function which when called should
>  > >  return and/or the local IP address and the port number to which SSL is
>  > >  bound on the system.
>  >
>  > Use the NSPR function 
> PR_GetSockName:http://developer.mozilla.org/en/docs/PR_GetSockNamehttp://www.mozilla.org/projects/nspr/reference/html/priofnc.html#19250
>  >
>  > Wan-Teh
>
>  i have the same question, i need the Local IP.
>
>  I create a socket, call PR_GetSockName, it returns 0.0.0.0 (on a mac
>  with a recent, but not the most recent release of NSPR)
>
>  so, not only is this not working, but this should not be the way to do
>  this anyway, there should be a way to get the local IP without
>  creating a socket.

Your question is different.  He needs the local IP address and port
number bound to an SSL socket.  You need the local IP, period.
No port number, and no sockets.

So PR_GetSockName is not the right function for your question.
Unfortunately there is no NSPR function for your question.

One method some people use is to call
PR_GetSystemInfo(PR_SI_HOSTNAME_UNTRUNCATED)
to get the local host name, and then call PR_GetHostByName or
PR_GetAddrInfoByName
to get the IP addresses.  This unfortunately requires a DNS lookup,
when we know the answer should be available locally.

Wan-Teh
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to