Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bugfixes

  • Loading branch information...
commit c12dd71c5cb778e26a8c8af4777d719d48878236 1 parent ed5b95f
pnomolos pnomolos authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 classes/idealpaymentgateway_helper.php
10 classes/idealpaymentgateway_helper.php
View
@@ -138,16 +138,22 @@ public static function get_certificate($host_obj, $field = "certificate") {
$certificate = $host_obj->{$field};
try {
$is_string = openssl_x509_read($certificate);
+ } catch (Exception $e) {
+ // Couldn't read it from the string, try a file next
+ $is_string = null;
+ }
+
+ try {
if (!$is_string) {
if (file_exists($certificate) && is_readable($certificate)) {
$certificate = openssl_x509_read(file_get_contents($certificate));
}
}
} catch (Exception $e) {
- // We don't want to feed the exception back up the chain, just return null
+ // Couldn't read from the file, bail
return null;
}
-
+
$data = null;
if(!openssl_x509_export($certificate, $data)) {
return null;
Please sign in to comment.
Something went wrong with that request. Please try again.