Anaplan API 2.0 Python Library Certificate Error

forestsummers
Occasional Contributor

Anaplan API 2.0 Python Library Certificate Error

Hi,

 

We are trying to change from basic authentication to using a certificate.  I am using the Anaplan API 2.0 Python Library.

 

When running AnaplanConnection function I am getting the following error that I traced to the anaplan_auth.py. 

 

TypeError: from_buffer() cannot return the address of a unicode object

 

I have tried troubleshooting, but I have not been able to come up with any solutions.  Has anyone else had this issue?

 

It comes from this line of code:

key = serialization.load_pem_private_key(privKey, None, backend=backend)

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
forestsummers
Occasional Contributor

Re: Anaplan API 2.0 Python Library Certificate Error

@JaredDolich 

 

I eventually figured it out.  I was passing the pem files as the name of the file string and not the certificate value.  I fixed the code and now it works.      

View solution in original post

4 REPLIES 4
JaredDolich
Moderator

Re: Anaplan API 2.0 Python Library Certificate Error

@forestsummers 

Good job moving to a certificate. That's the best way. Two suggestions for you.

  • Make sure you have a private CA Certficate for an email address, called an “S/MIME Certificate” or an “email Certificate”. There are many types out there but you need one that can be associated with the email address you're using.
  • Read @chase.hippen most excellent article with examples on how to use certificates with Python.

Jared Dolich
forestsummers
Occasional Contributor

Re: Anaplan API 2.0 Python Library Certificate Error

Hi Jared,

 

Thanks for helping, and for the resource.  I have not solved the issue, but maybe there is something I am missing.

forestsummers
Occasional Contributor

Re: Anaplan API 2.0 Python Library Certificate Error

@JaredDolich 

 

I eventually figured it out.  I was passing the pem files as the name of the file string and not the certificate value.  I fixed the code and now it works.      

View solution in original post

lucky69
New Contributor

Re: Anaplan API 2.0 Python Library Certificate Error

Hello,

 

Thanks for the update and quick reply. I'll be sure to keep an eye on this thread. Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution.