<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<div style="">
<p dir="auto">This line <a href="https://gitlab.com/gnutls/gnutls/blob/master/src/socket.c#L250">https://gitlab.com/gnutls/gnutls/blob/master/src/socket.c#L250</a> is always using socket.</p>
<p dir="auto">Maybe we can reuse --verify-hostname arg for that, or create a new "request hostname/xmpp host" (as openssl does):</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">// NOT TESTED</span>
<span id="LC2" class="line" lang="plaintext">const char *host;</span>
<span id="LC3" class="line" lang="plaintext">if (HAVE_OPT(VERIFY_HOSTNAME)) {</span>
<span id="LC4" class="line" lang="plaintext">       host = OPT_ARG(VERIFY_HOSTNAME);</span>
<span id="LC5" class="line" lang="plaintext">       canonicalize_host((char *) host, NULL, 0);</span>
<span id="LC6" class="line" lang="plaintext">} else</span>
<span id="LC7" class="line" lang="plaintext">       host = socket->hostname;</span>
<span id="LC8" class="line" lang="plaintext">snprintf(buf, sizeof(buf), "<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='%s' version='1.0'>\n", host);</span></code></pre>
<p dir="auto">Or redefine socket->hostname inside socket_open2 after conn is openned. Or even a new field in socket for that.</p>
<p dir="auto">I don't know what is the best option. I only know that socket->hostname used by STARTTLS (any protocol) should be user definable.</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/777#note_175952489">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/73e1d4285a9eca70e3fd71954e08c809/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/issues/777#note_175952489"}}</script>

</p>
</div>
</body>
</html>