On Mon, 19 Apr 2010, Sad Clouds wrote:
On Mon, 19 Apr 2010 11:58:51 +0200 (CEST)
Ondrej Jombik <jom...@platon.org> wrote:
I do need this for client side. Machine where connection is
originating has several IP addresses and the remote machine will
accept connection only from one of those. So I need to choose exactly
one source IP address when creating connection.
Can your example be modified for this?
The code for the client side is very similar. So you set IP address and
port number and then call bind() to associate source IP address with the
socket, otherwise OS kernel will choose IP address for you. To connect
to the server you call connect().
Once you have a connected socket, you creae SSL object, call
SSL_set_fd() to associate connected socket with SSL object and then
call SSL_connect() to initiate SSL handshake.
I think this should work, just give it a try.
Sad, thank you for your help! After bit of tweaking it is now working
as desired.
However I'm no longer connecting with BIO_do_connect() and using
BIO_do_handshake() for handshake, but I'm conecting with regular
connect() (preceding with socket() and bind() as desired) and performing
SSL handshake with SSL_connect().
Tommorow, I will post here a simple snipet of code, as others may find
it also useful, somewhere in the future.
--
Ondrej JOMBIK
Platon Technologies Ltd., Hlavna 3, Sala SK-92701
+421 903 PLATON - i...@platon.org - http://platon.org
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org