aboutsummaryrefslogtreecommitdiff
path: root/src/qt/paymentrequestplus.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-16 11:18:45 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-16 11:19:07 +0100
commita353ad4cdb085c23e4c157063c5540326eacb4e2 (patch)
treec4dd6c44f69932c0a01b50e7cd107d758fc1fd13 /src/qt/paymentrequestplus.cpp
parentc29568a68624bc2987637d601879fbbcd5be3b9d (diff)
parent851296a72fc6930404abb94f4175acc1b1aab859 (diff)
Merge pull request #5636
851296a [Qt] add option to allow self signed root certs (for testing) (Philip Kaufmann)
Diffstat (limited to 'src/qt/paymentrequestplus.cpp')
-rw-r--r--src/qt/paymentrequestplus.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp
index 35846bc153..39171c89eb 100644
--- a/src/qt/paymentrequestplus.cpp
+++ b/src/qt/paymentrequestplus.cpp
@@ -9,6 +9,8 @@
#include "paymentrequestplus.h"
+#include "util.h"
+
#include <stdexcept>
#include <openssl/x509.h>
@@ -150,7 +152,13 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
int result = X509_verify_cert(store_ctx);
if (result != 1) {
int error = X509_STORE_CTX_get_error(store_ctx);
- throw SSLVerifyError(X509_verify_cert_error_string(error));
+ // For testing payment requests, we allow self signed root certs!
+ // This option is just shown in the UI options, if -help-debug is enabled.
+ if (!(error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT && GetBoolArg("-allowselfsignedrootcertificates", false))) {
+ throw SSLVerifyError(X509_verify_cert_error_string(error));
+ } else {
+ qDebug() << "PaymentRequestPlus::getMerchant: Allowing self signed root certificate, because -allowselfsignedrootcertificates is true.";
+ }
}
X509_NAME *certname = X509_get_subject_name(signing_cert);