Comment 5 for bug 2067503

Revision history for this message
Anton Troyanov (troyanov) wrote :

Hi Andrew,

Thanks for the very detailed explanation. I was able to reproduce it.
May I ask you to try this patch?

diff --git a/src/maascli/cli.py b/src/maascli/cli.py
index 47a62c82f..dfe921018 100644
--- a/src/maascli/cli.py
+++ b/src/maascli/cli.py
@@ -98,7 +98,7 @@ class cmd_login(Command):
         if options.cacerts is not None:
             cacerts = options.cacerts.read()
             try:
- crypto.load_certificate(crypto.FILETYPE_PEM, cacerts)
+ crypto.load_certificate(crypto.FILETYPE_PEM, cacerts.encode('utf-8'))
             except crypto.Error:
                 raise CommandError("Invalid PEM material")