}
# endif /* HAVE_SSLSETPROTOCOLVERSIONMAX */
+ /*
+ * In general, don't verify certificates since things like the common name
+ * often do not match...
+ */
+
+ if (!error)
+ {
+ error = SSLSetEnableCertVerify(http->tls, false);
+ DEBUG_printf(("4http_setup_ssl: SSLSetEnableCertVerify, error=%d",
+ (int)error));
+ }
+
# ifdef HAVE_SECCERTIFICATECOPYDATA
if (!error)
{
if (!error && cg->server_cert_cb != NULL)
{
- error = SSLSetEnableCertVerify(http->tls, false);
- DEBUG_printf(("4http_setup_ssl: SSLSetEnableCertVerify, error=%d",
- (int)error));
-
- if (!error)
- {
- error = SSLSetSessionOption(http->tls,
- kSSLSessionOptionBreakOnServerAuth, true);
- DEBUG_printf(("4http_setup_ssl: kSSLSessionOptionBreakOnServerAuth, "
- "error=%d", (int)error));
- }
+ error = SSLSetSessionOption(http->tls,
+ kSSLSessionOptionBreakOnServerAuth, true);
+ DEBUG_printf(("4http_setup_ssl: kSSLSessionOptionBreakOnServerAuth, "
+ "error=%d", (int)error));
}
# endif /* HAVE_SECCERTIFICATECOPYDATA */
+ /*
+ * Let the server know which hostname/domain we are trying to connect to
+ * in case it wants to serve up a certificate with a matching common name.
+ */
+
if (!error)
{
hostname = httpAddrLocalhost(http->hostaddr) ? "localhost" : http->hostname;
httpFreeCredentials(credentials);
}
- DEBUG_printf(("4http_setup_ssl: Server certificate callback returned "
- "%d.", (int)error));
+ DEBUG_printf(("4http_setup_ssl: Server certificate callback "
+ "returned %d.", (int)error));
}
break;