mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
return empty string in case of certificate export failure
This commit is contained in:
1 parent
4d582dae8e
commit
de92af95d3
1 file changed
+1
@@ -425,6 +425,7 @@ Certificate::toString() const
|
||||
int err = gnutls_x509_crt_export(cert, GNUTLS_X509_FMT_PEM, &(*str.begin()), &buf_sz);
|
||||
if (err != GNUTLS_E_SUCCESS) {
|
||||
std::cerr << "Could not export certificate - " << gnutls_strerror(err) << std::endl;
|
||||
return {};
|
||||
}
|
||||
str.resize(buf_sz);
|
||||
return str;
|
||||
|
||||
Reference in new issue
Block a user