Just note that the IP address is not authenticated and thus is untrusted.
Whether this matters or not depends on what you are doing with it.

_____________________________________
Greg Stark
Ethentica, Inc.
[EMAIL PROTECTED]
_____________________________________



----- Original Message -----
From: "Christopher J. Madsen" <[EMAIL PROTECTED]>
To: "OpenSSL Users" <[EMAIL PROTECTED]>
Sent: Sunday, March 11, 2001 6:21 PM
Subject: How do I get the remote IP after BIO_do_accept?


> I'm writing a simple server with openssl-0.9.6.  It's going rather
> well so far, but I can't figure out how to get the IP address of the
> remote connection after I call BIO_do_accept.
>
> Poking around in the source code, it appears this information is being
> stored in the accept BIO, but there doesn't seem to be any way to
> retrieve it (except poking around in undocumented internal structures,
> which doesn't seem like a good idea).
>
> Am I missing something?
>
> PS:  I wouldn't even be attempting this project without OpenSSL.
> Thanks for all your hard work.
>
> --
> Chris Madsen                                [EMAIL PROTECTED]
>  ------- http://www.geocities.com/SiliconValley/Heights/3222/ -------
> ______________________________________________________________________

There isn't a way to do this at the OpenSSL level.

Presumably you can retrieve the remote IP address if you have the
underlying socket? If so you can call BIO_get_fd() (which should really
be BIO_get_socket() ) to get it from the socket BIO. See the
BIO_s_socket manual page.

Steve.
--
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to