SSLerror when running Target API with Python | Community
Skip to main content
jonathanl557422
November 18, 2020
Solved

SSLerror when running Target API with Python

  • November 18, 2020
  • 1 reply
  • 4308 views

I'm able to connect and get API responses with an API client (Insomnia).

However, I keep getting an SSL error when trying to do the same with Python. Anyone managed to get it to work without the SSL error or using verify=false?

 

This is the error I get:

 

SSLError: HTTPSConnectionPool(host='mc.adobe.io', port=443): Max retries exceeded with url: /sunlifeassurance/target/activities/ (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by evidana

Are you able to download the cert from https://mc.adobe.io/ and reference to it in the verify param? Not a python expert and not sure what library you are using. 

1 reply

evidanaCommunity AdvisorAccepted solution
Community Advisor
November 18, 2020

Are you able to download the cert from https://mc.adobe.io/ and reference to it in the verify param? Not a python expert and not sure what library you are using. 

zach_shearer
November 23, 2020

I don't have scripts that I run with Adobe often enough to not have to research this each time I do it; see below for the process that I noted for myself next time I had to run the script. I did find working with the Postman templates that they share quite helpful: https://developers.adobetarget.com/api/#admin-postman-collection:~:text=Admin%20Postman%20Collection,-Postman

 

Steps to get the access token:
> 1. Find private key: /file-path-to-key/private.key
>> Note that if you don't have private key that is still valid, you'll need to get a new one here:
>> https://helpx.adobe.com/marketing-cloud-core/kb/adobe-io-authentication-step-by-step.html
> 2. Generate JWT token with private key:
>> https://console.adobe.io/projects/xxx/xxxx/credentials/xxxx/details
> 3. Use postman to generate access token:
>> https://www.adobe.io/authentication/auth-methods.html#exchanging-jwt-to-retrieve-an-access-token:~:text=Exchanging%20JWT%20to%20retrieve%20an%20access%20token,-To