mirror of
https://github.com/imapsync/imapsync.git
synced 2024-11-17 00:02:29 +01:00
Merge pull request #381 from FreddleSpl0it/improve-xoauth2
Improve XOAUTH2 authmech
This commit is contained in:
commit
b0619eb2c8
6
imapsync
6
imapsync
@ -8902,6 +8902,7 @@ sub xoauth2
|
|||||||
require HTML::Entities ;
|
require HTML::Entities ;
|
||||||
require JSON ;
|
require JSON ;
|
||||||
require JSON::WebToken::Crypt::RSA ;
|
require JSON::WebToken::Crypt::RSA ;
|
||||||
|
require Crypt::OpenSSL::PKCS12 ;
|
||||||
require Crypt::OpenSSL::RSA ;
|
require Crypt::OpenSSL::RSA ;
|
||||||
require Encode::Byte ;
|
require Encode::Byte ;
|
||||||
require IO::Socket::SSL ;
|
require IO::Socket::SSL ;
|
||||||
@ -8942,8 +8943,9 @@ sub xoauth2
|
|||||||
|
|
||||||
$sync->{ debug } and myprint( "Service account: $iss\nKey file: $keyfile\nKey password: $keypass\n");
|
$sync->{ debug } and myprint( "Service account: $iss\nKey file: $keyfile\nKey password: $keypass\n");
|
||||||
|
|
||||||
# Get private key from p12 file (would be better in perl...)
|
# Get private key from p12 file
|
||||||
$key = `openssl pkcs12 -in "$keyfile" -nodes -nocerts -passin pass:$keypass -nomacver`;
|
my $pkcs12 = Crypt::OpenSSL::PKCS12->new_from_file($keyfile);
|
||||||
|
$key = $pkcs12->private_key($keypass);
|
||||||
|
|
||||||
$sync->{ debug } and myprint( "Private key:\n$key\n");
|
$sync->{ debug } and myprint( "Private key:\n$key\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user