<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:10.0pt'>I have a colleague who is using OpenSSL 1.0.1j and BIOs to connect to servers.   Given the requirement that his software must now connect to IPv6 addresses, still using the BIO interface, is it supposed to work?      That is, can a BIO caller pass a string hostname:port like this “[</span><span style='font-size:9.0pt;font-family:"Courier New"'>2620:0:170:28a1::1003]:443” </span><span style='font-size:10.0pt'>to BIO and have it work? <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>I see a reference to Patch #1365 which deals with openssl s_client and doing left-side truncation of an IPv6 address specified in the –connect option.   The discussion of this patch is <a href="http://rt.openssl.org/Ticket/Display.html?id=1365&user=guest&pass=guest">http://rt.openssl.org/Ticket/Display.html?id=1365&user=guest&pass=guest</a> but it looks like it’s a patch for the application, not the BIO.   In fact in the plain build of 1.0.1j I have with OPENSSL_USE_IPV6 specified, still has this left-side truncation issue (I see code in crypto/apps/s_socket.c:extract_host_port() which simply looks for a colon and takes what’s on the right side for the port, assuming the left side is a dotted decimal IPv4 address.  <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>I have already suggested to this colleague that the issue with IPv6 is name and address resolution, not socket I/O.   If he handles the name resolution himself, creates a socket with the right address family and sockaddr format, and then uses the right BIO calls, it should work.   We do our own name/address handling and don’t use BIO in my application so I have never studied how to do it there. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>Thanks for your advice<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>Dave<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal>+-+-+-+-+-+-+-+-+- <o:p></o:p></p><p class=MsoNormal>Dave McLellan, Enterprise Storage Software Engineering, EMC Corporation, 176 South St.<o:p></o:p></p><p class=MsoNormal>Mail Stop 176-V1 1/P-36, Hopkinton, MA 01749<o:p></o:p></p><p class=MsoNormal>Office:    508-249-1257, FAX: 508-497-8027, Mobile:   978-500-2546, dave.mclellan@emc.com<o:p></o:p></p><p class=MsoNormal>+-+-+-+-+-+-+-+-+-<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>