[EXTERNAL] Re: Replacement for BIO_get_port(), BIO_get_host_ip()

Shivakumar Poojari Shivakumar.Poojari at rbbn.com
Thu Oct 7 07:18:37 UTC 2021


Hi Matt,
The steps suggested are similarly to the deprecated function so simply  I used the same code in static function, But i need support for IPV6 as well in the same function

The function needs to have compatibility to support for both ipv6 and ipv4, do we have any new function to support both


thanks,
Shivakumar.
________________________________
From: Matt Caswell <matt at openssl.org>
Sent: Monday, September 27, 2021 3:05 PM
To: Shivakumar Poojari <Shivakumar.Poojari at rbbn.com>; openssl-users at openssl.org <openssl-users at openssl.org>
Cc: Paramashivaiah, Sunil <Sunil.Paramashivaiah at rbbn.com>
Subject: [EXTERNAL] Re: Replacement for BIO_get_port(), BIO_get_host_ip()



On 24/09/2021 07:05, Shivakumar Poojari wrote:
> Hi
> BIO_get_port(), BIO_get_host_ip(),  were deprecated in OpenSSL 1.1.0.
> Trying for replacement for OpenSSl 3.0
>
> Gone through the below man page, but not found alternative function.
>
> https://clicktime.symantec.com/3Xv8ZiB6xAtjRGsCNHevANW6H2?u=https%3A%2F%2Fwww.openssl.org%2Fdocs%2Fmanmaster%2Fman3%2FBIO_connect.html
> <https://clicktime.symantec.com/3Xv8ZiB6xAtjRGsCNHevANW6H2?u=https%3A%2F%2Fwww.openssl.org%2Fdocs%2Fmanmaster%2Fman3%2FBIO_connect.html>
>
> please suggest,

These functions are deprecated because they only support IPv4.

Instead you can use BIO_lookup() (or possibly BIO_lookup_ex()) to lookup
the given host/service (first and second parameters to BIO_lookup()
respectively). Equivalent 3rd/4th/5th parameters to BIO_lookup() might
be BIO_LOOKUP_CLIENT, AF_INET (for IPv4) and SOCK_STREAM (for TCP).

This will return you an initialised BIO_ADDRINFO() object (which you
will have to later free using BIO_ADDRINFO_free()).

 From the BIO_ADDRINFO object you can get a pointer to an underlying
BIO_ADDR using BIO_ADDRINFO_address(addrinfo). Finally you can use
BIO_ADDR_rawaddress() to get address info, or BIO_ADDR_rawport() to get
port info:

See:
https://clicktime.symantec.com/3EBngctzbwbGZ7EtRw3Ks6N6H2?u=https%3A%2F%2Fwww.openssl.org%2Fdocs%2Fman3.0%2Fman3%2FBIO_lookup.html
https://clicktime.symantec.com/33SMrAMvMeCpangnxBCzSv96H2?u=https%3A%2F%2Fwww.openssl.org%2Fdocs%2Fman3.0%2Fman3%2FBIO_ADDR_rawaddress.html

Matt

Notice: This e-mail together with any attachments may contain information of Ribbon Communications Inc. and its Affiliates that is confidential and/or proprietary for the sole use of the intended recipient. Any review, disclosure, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and then delete all copies, including any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20211007/6a82f724/attachment-0001.html>


More information about the openssl-users mailing list