* At that point, just give up.
*/
netsec_err(errstr, "Internal error: wanted to printf() a total of "
- "%d bytes, but our buffer size was only %d bytes",
+ "%d bytes, but our buffer size was only %d bytes",
rc, nsc->ns_outbufsize);
return NOTOK;
}
if (nsc->ns_snoop_savebuf) {
cb_len += strlen(nsc->ns_snoop_savebuf);
nsc->ns_snoop_savebuf = mh_xrealloc(nsc->ns_snoop_savebuf,
- outlen);
+ outlen);
ptr = nsc->ns_snoop_savebuf;
} else {
ptr = snoopoutbuf;
&xoauth_client_res, &xoauth_client_res_len,
nsc->ns_snoop ? stderr : NULL) != OK) {
netsec_err(errstr, "Internal error: Unable to get OAuth2 "
- "bearer token");
+ "bearer token");
return NOTOK;
}
*/
rc = sasl_client_start(nsc->sasl_conn,
- nsc->sasl_mech ? nsc->sasl_mech : mechlist, NULL,
+ nsc->sasl_mech ? nsc->sasl_mech : mechlist, NULL,
(const char **) &saslbuf, &saslbuflen,
&chosen_mech);
*/
while (rc == SASL_CONTINUE) {
- /*
+ /*
* Call our SASL callback, which will handle the details of
* reading data from the network.
*/
return NOTOK;
}
+ if (!nsc->ns_hostname) {
+ netsec_err(errstr, "Internal error: hostname not set");
+ return NOTOK;
+ }
+
/*
* Create the SSL structure which holds the data for a single
* TLS connection.
SSL_set_bio(ssl, rbio, wbio);
SSL_set_connect_state(ssl);
+ /*
+ * Use the hostname to set the Server Name Indicator extension
+ */
+
+ SSL_set_tlsext_host_name(ssl, nsc->ns_hostname);
+
/*
* If noverify is NOT set, then do certificate validation.
* Turning on SSL_VERIFY_PEER will verify the certificate chain
#endif /* HAVE_X509_VERIFY_PARAM_SET1_HOST */
SSL_set_verify(ssl, SSL_VERIFY_PEER, NULL);
- if (! nsc->ns_hostname) {
- netsec_err(errstr, "Internal error: hostname not set and "
- "certification verification enabled");
- SSL_free(ssl);
- return NOTOK;
- }
#ifdef HAVE_X509_VERIFY_PARAM_SET1_HOST
param = SSL_get0_param(ssl);
if (! ssl_bio) {
netsec_err(errstr, "Unable to create a SSL BIO: %s",
- ERR_error_string(ERR_get_error(), NULL));
+ ERR_error_string(ERR_get_error(), NULL));
SSL_free(ssl);
return NOTOK;
}
int rc = 127;
if (! errstr)
- return;
+ return;
do {
errbufsize = rc + 1;