summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-08-05 10:54:39 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-08-05 10:54:39 +0200
commitc5583eb4408e0b085d2ce1a879bf75fe4ad93af0 (patch)
tree0a565715c0ce5d2dcf7442e1a3e8d363e4358992
parent20094b76e5e634eed970a7ed3411aec2b1449b25 (diff)
downloadcurl-bagder/gnutlsserv-random-port.tar.gz
gtls: survive not being able to get name/issuerbagder/gnutlsserv-random-port
-rw-r--r--lib/vtls/gtls.c23
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);