narrowed some source lines to fit in 80 cols
This commit is contained in:
parent
bec97a0999
commit
1fde1431c9
14
lib/ssluse.c
14
lib/ssluse.c
@ -660,7 +660,10 @@ Curl_SSLConnect(struct connectdata *conn)
|
|||||||
|
|
||||||
if (data->set.ssl.verifyhost) {
|
if (data->set.ssl.verifyhost) {
|
||||||
char peer_CN[257];
|
char peer_CN[257];
|
||||||
if (X509_NAME_get_text_by_NID(X509_get_subject_name(conn->ssl.server_cert), NID_commonName, peer_CN, sizeof(peer_CN)) < 0) {
|
if (X509_NAME_get_text_by_NID(X509_get_subject_name(conn->ssl.server_cert),
|
||||||
|
NID_commonName,
|
||||||
|
peer_CN,
|
||||||
|
sizeof(peer_CN)) < 0) {
|
||||||
failf(data, "SSL: unable to obtain common name from peer certificate");
|
failf(data, "SSL: unable to obtain common name from peer certificate");
|
||||||
X509_free(conn->ssl.server_cert);
|
X509_free(conn->ssl.server_cert);
|
||||||
return CURLE_SSL_PEER_CERTIFICATE;
|
return CURLE_SSL_PEER_CERTIFICATE;
|
||||||
@ -668,13 +671,16 @@ Curl_SSLConnect(struct connectdata *conn)
|
|||||||
|
|
||||||
if (!strequal(peer_CN, conn->hostname)) {
|
if (!strequal(peer_CN, conn->hostname)) {
|
||||||
if (data->set.ssl.verifyhost > 1) {
|
if (data->set.ssl.verifyhost > 1) {
|
||||||
failf(data, "SSL: certificate subject name '%s' does not match target host name '%s'",
|
failf(data, "SSL: certificate subject name '%s' does not match "
|
||||||
peer_CN, conn->hostname);
|
"target host name '%s'",
|
||||||
|
peer_CN, conn->hostname);
|
||||||
X509_free(conn->ssl.server_cert);
|
X509_free(conn->ssl.server_cert);
|
||||||
return CURLE_SSL_PEER_CERTIFICATE;
|
return CURLE_SSL_PEER_CERTIFICATE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
infof(data, "\t common name: %s (does not match '%s')\n", peer_CN, conn->hostname);
|
infof(data,
|
||||||
|
"\t common name: %s (does not match '%s')\n",
|
||||||
|
peer_CN, conn->hostname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
infof(data, "\t common name: %s (matched)\n", peer_CN);
|
infof(data, "\t common name: %s (matched)\n", peer_CN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user