BIO_do_connect() fails with IPv6 address

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

BIO_do_connect() fails with IPv6 address

shyamala
Hi, I have some queries regarding BIO_* calls. Our application uses BIO_* calls (BIO_do_connect, BIO_new_connect etc) to establish connection with Onboard Administrator. This works fine with IPv4 IP address, but BIO_do_connect fails when IPv6 address is used. Looks like BIO_* calls don't support IPv6. Could you please confirm whether BIO_* calls support IPv6? If not, is there any alternate solution for this? Regards, Shyamala
Reply | Threaded
Open this post in threaded view
|

Re: BIO_do_connect() fails with IPv6 address

Wim Lewis-3

On 7 Jan 2013, at 10:21 PM, shyamala wrote:
> Hi, I have some queries regarding BIO_* calls. Our application uses BIO_* calls (BIO_do_connect, BIO_new_connect etc) to establish connection with Onboard Administrator. This works fine with IPv4 IP address, but BIO_do_connect fails when IPv6 address is used. Looks like BIO_* calls don't support IPv6. Could you please confirm whether BIO_* calls support IPv6? If not, is there any alternate solution for this? Regards, Shyamala

The BIO_s_connect() BIO method (which is used by BIO_new_connect()) only supports IPv4. (See also this thread on the subject from a couple years ago: [1]).

You can make IPv6 connections (or, presumably, other stream socket protocols) by doing the underlying socket() and connect() calls yourself, then wrapping the connected fd in a BIO using BIO_socket_nbio(), BIO_new_socket(), BIO_set_conn_hostname().

[1] http://www.mail-archive.com/openssl-users@.../msg65674.html


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: BIO_do_connect() fails with IPv6 address

shyamala
Hi Wim,
 
Thanks for your quick response.
 
I have seen the threads on BIO_s_connect (which does not support IPv6) in google. And I have also tried using socket() and connect() calls to establish connection, then used the connected fd in a BIO using BIO_set_nbio(), BIO_new_socket(), BIO_do_connect() and BIO_should_retry(). But still it is not working (Even this is not working with IPv4 also). Any suggestions on this?
 
Regards,
Shyamala

On Wed, Jan 9, 2013 at 3:36 PM, Wim Lewis-3 [via OpenSSL] <[hidden email]> wrote:

On 7 Jan 2013, at 10:21 PM, shyamala wrote:
> Hi, I have some queries regarding BIO_* calls. Our application uses BIO_* calls (BIO_do_connect, BIO_new_connect etc) to establish connection with Onboard Administrator. This works fine with IPv4 IP address, but BIO_do_connect fails when IPv6 address is used. Looks like BIO_* calls don't support IPv6. Could you please confirm whether BIO_* calls support IPv6? If not, is there any alternate solution for this? Regards, Shyamala

The BIO_s_connect() BIO method (which is used by BIO_new_connect()) only supports IPv4. (See also this thread on the subject from a couple years ago: [1]).

You can make IPv6 connections (or, presumably, other stream socket protocols) by doing the underlying socket() and connect() calls yourself, then wrapping the connected fd in a BIO using BIO_socket_nbio(), BIO_new_socket(), BIO_set_conn_hostname().

[1] http://www.mail-archive.com/openssl-users@.../msg65674.html


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]



If you reply to this email, your message will be added to the discussion below:
http://openssl.6102.n7.nabble.com/BIO-do-connect-fails-with-IPv6-address-tp43035p43071.html
To unsubscribe from BIO_do_connect() fails with IPv6 address, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: BIO_do_connect() fails with IPv6 address

shyamala
Hi, Please let me know if anybody has suggestions/solutions for the below issue. Thanks a lot in advance. Regards, Shyamala