diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-08-05 10:54:39 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-08-05 14:44:48 +0200 |
commit | a0c461434c747ad6daff0c85c0a8bbe9cfc44d75 (patch) | |
tree | eb232fbe3b4b13d26bc3728dba2bd4a019b0f415 /lib | |
parent | 06aa77ae33519ae93b121032eff795df4c498d09 (diff) | |
download | curl-a0c461434c747ad6daff0c85c0a8bbe9cfc44d75.tar.gz |
gtls: survive not being able to get name/issuer
Closes #5778
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vtls/gtls.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 75331388c..16b0bd6cb 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1236,20 +1236,23 @@ gtls_connect_step3(struct connectdata *conn, rc = gnutls_x509_crt_get_dn2(x509_cert, &certfields); - if(rc != 0) - return CURLE_OUT_OF_MEMORY; - infof(data, "\t subject: %s\n", certfields.data); + 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); - showtime(data, "start date", certclock); + certclock = gnutls_x509_crt_get_activation_time(x509_cert); + showtime(data, "start date", certclock); - certclock = gnutls_x509_crt_get_expiration_time(x509_cert); - showtime(data, "expire date", certclock); + 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; - infof(data, "\t issuer: %s\n", certfields.data); + if(rc) + infof(data, "Failed to get certificate issuer\n"); + else + infof(data, "\t issuer: %s\n", certfields.data); #endif gnutls_x509_crt_deinit(x509_cert); |