Dev Space

Customize & extend the power of Alteryx. SDKs, APIs, custom tools, and more!

Download Tool - API requiring Client Certificate for SSL?

dataMack
12 - Quasar

I'm trying to build a connection using the Download tool to an API that requires an SSL certificate and key to be provided on the API request.  Any idea how to pass certificate (*.crt) and key (*.key) files along with the request?  Hoping @TashaA or @MattD may have done this before.

 

I typically use Postman when I'm testing out an API so I can see how to formulate a request.  Here's their documentation on Certificates:  https://www.getpostman.com/docs/v6/postman/sending_api_requests/certificates

 

With that tool, you simply point to the certificate and key files and tell it what domain it applies to, and then when you do a request, it adds the keyPath and pemPath Client Certificate files to the request.

9 REPLIES 9
TashaA
Alteryx Alumni (Retired)

Hey @dataMack!

 

Great question. In my opinion, the Download Tool may not be your tool of choice in this particular situation, as it does not really enable to use certificates or keys from file.

 

What you might want to do instead, is use postman to perfect your request, and use postman to generate the cURL code you would need. There's a nice export feature in postman for this. 

 

Then you could try to use the Run Command Tool in Designer to execute cURL.exe (this would mean any computer running this workflow would also need the cURL program.)

 

-Tasha

dataMack
12 - Quasar

Thanks for the suggestion of cURL.  That may work but potentially presents a dependency issue if sharing the workflow with other analysts or publishing to Server with the intention of making it an analytic app.

 

Perhaps client certificates is something @Ozzie can include in his PythonSDK -based enhanced version of the download tool (https://community.alteryx.com/t5/Dev-Space/Watch-Ozzie-code/m-p/127628#M250) since including certificates in the request is more straightforward with Python.  Ex.:

import requests
headers = {'Authorization': 'Basic [Removed]'}
requests.get('urlForRequest', cert=('certificate.cer', 'dataquery.key'), headers=headers).content
Ozzie
Alteryx
Alteryx

@dataMack This is actually one of the reasons I thought of creating a new Download tool. We had a huge demand from a lot of customers so I figured this one of the most import things to add.

dataMack
12 - Quasar

How is your new version coming along?  Do you have it posted on GitHub?  I'd be happy to be a tester for you

Ozzie
Alteryx
Alteryx

Haven't had much time recently to work on it. When I get more time I'll certainly work on it and keep you updated. I'll push everything here soon: https://github.com/ozzieD/Python---Download-Tool

jwalder
10 - Fireball

We built a tool to allow the use of a p12 client side certificate for REST based APIs. (p12: https://en.wikipedia.org/wiki/PKCS_12) If that is the type of certificate you are using then it should work great for you. https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Partner-Tools/ta-p/123297

rohan_tibarewala
8 - Asteroid

@jwalder I couldn't find the tool which would allow using p12 certifcate in the link you provided, can you please calrify which tool would that be? https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Partner-Tools/ta-p/123297 

jwalder
10 - Fireball

Not sure what happened to that post, it appears to be truncated. If you click on the link for the Complex XML Input Tool that is at the bottom of that post, it will take you to the Teknion website... you will have to navigate from there as I am pretty sure if I post a link directly here then the Alteryx community police will get upset at me. I will send you a link directly in PM though.

rohan_tibarewala
8 - Asteroid

@jwalderUnfortunately, our organization did not allow third party tools to be installed, so i could not try it out. Thank you for your responses though. Much appreciated.