1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

gtls: survive not being able to get name/issuer

Closes #5778
This commit is contained in:
Daniel Stenberg 2020-08-05 10:54:39 +02:00
parent 06aa77ae33
commit a0c461434c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1236,8 +1236,9 @@ gtls_connect_step3(struct connectdata *conn,
rc = gnutls_x509_crt_get_dn2(x509_cert, &certfields);
if(rc != 0)
return CURLE_OUT_OF_MEMORY;
if(rc)
infof(data, "Failed to get certificate name\n");
else {
infof(data, "\t subject: %s\n", certfields.data);
certclock = gnutls_x509_crt_get_activation_time(x509_cert);
@ -1245,10 +1246,12 @@ gtls_connect_step3(struct connectdata *conn,
certclock = gnutls_x509_crt_get_expiration_time(x509_cert);
showtime(data, "expire date", certclock);
}
rc = gnutls_x509_crt_get_issuer_dn2(x509_cert, &certfields);
if(rc != 0)
return CURLE_OUT_OF_MEMORY;
if(rc)
infof(data, "Failed to get certificate issuer\n");
else
infof(data, "\t issuer: %s\n", certfields.data);
#endif