mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
squelch noisy "cert already in hash table" errors
This commit is contained in:
parent
c015814321
commit
c8c51528bd
@ -184,7 +184,7 @@ load_certificates_from_pem_ram(const char *data, size_t data_size) {
|
|||||||
if (itmp->x509) {
|
if (itmp->x509) {
|
||||||
int result = X509_STORE_add_cert(_x509_store, itmp->x509);
|
int result = X509_STORE_add_cert(_x509_store, itmp->x509);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
notify_ssl_errors();
|
notify_debug_ssl_errors();
|
||||||
} else {
|
} else {
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ load_certificates_from_pem_ram(const char *data, size_t data_size) {
|
|||||||
} else if (itmp->crl) {
|
} else if (itmp->crl) {
|
||||||
int result = X509_STORE_add_crl(_x509_store, itmp->crl);
|
int result = X509_STORE_add_crl(_x509_store, itmp->crl);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
notify_ssl_errors();
|
notify_debug_ssl_errors();
|
||||||
} else {
|
} else {
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ load_certificates_from_der_ram(const char *data, size_t data_size) {
|
|||||||
|
|
||||||
int result = X509_STORE_add_cert(_x509_store, x509);
|
int result = X509_STORE_add_cert(_x509_store, x509);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
notify_ssl_errors();
|
notify_debug_ssl_errors();
|
||||||
} else {
|
} else {
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
@ -335,6 +335,34 @@ notify_ssl_errors() {
|
|||||||
#endif // REPORT_OPENSSL_ERRORS
|
#endif // REPORT_OPENSSL_ERRORS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: OpenSSLWrapper::notify_debug_ssl_errors
|
||||||
|
// Access: Public
|
||||||
|
// Description: As notify_ssl_errors(), but sends the output to debug
|
||||||
|
// instead of warning.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void OpenSSLWrapper::
|
||||||
|
notify_debug_ssl_errors() {
|
||||||
|
#ifdef REPORT_OPENSSL_ERRORS
|
||||||
|
static bool strings_loaded = false;
|
||||||
|
if (!strings_loaded) {
|
||||||
|
SSL_load_error_strings();
|
||||||
|
strings_loaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long e = ERR_get_error();
|
||||||
|
while (e != 0) {
|
||||||
|
if (express_cat.is_debug()) {
|
||||||
|
static const size_t buffer_len = 256;
|
||||||
|
char buffer[buffer_len];
|
||||||
|
ERR_error_string_n(e, buffer, buffer_len);
|
||||||
|
express_cat.debug() << buffer << "\n";
|
||||||
|
}
|
||||||
|
e = ERR_get_error();
|
||||||
|
}
|
||||||
|
#endif // REPORT_OPENSSL_ERRORS
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: OpenSSLWrapper::get_global_ptr
|
// Function: OpenSSLWrapper::get_global_ptr
|
||||||
// Access: Public, Static
|
// Access: Public, Static
|
||||||
|
@ -54,6 +54,7 @@ public:
|
|||||||
X509_STORE *get_x509_store();
|
X509_STORE *get_x509_store();
|
||||||
|
|
||||||
void notify_ssl_errors();
|
void notify_ssl_errors();
|
||||||
|
void notify_debug_ssl_errors();
|
||||||
|
|
||||||
static OpenSSLWrapper *get_global_ptr();
|
static OpenSSLWrapper *get_global_ptr();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user