Skip to content

Commit 33bed5d

Browse files
author
Aruna Lakmal
committed
clear openssl error stack as this causes to close database connection
1 parent 11855db commit 33bed5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/JWT.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,11 @@ private static function verify($msg, $signature, $key, $alg)
208208
list($function, $algorithm) = self::$supported_algs[$alg];
209209
switch($function) {
210210
case 'openssl':
211+
while ($msg = openssl_error_string()) {}
211212
$success = openssl_verify($msg, $signature, $key, $algorithm);
213+
while ($msg = openssl_error_string()) {$msglist[] = $msg;}
212214
if (!$success) {
213-
throw new DomainException("OpenSSL unable to verify data: " . openssl_error_string());
215+
throw new DomainException("OpenSSL unable to verify data: " . implode(',', $msglist));
214216
} else {
215217
return $signature;
216218
}

0 commit comments

Comments
 (0)