Referencing SSL certificates in KNIME GET Request

Hi,

I am currently working with a set of APIs which require SSL certificates to be referenced in GET requests.

The API documentation provides examples of such requests as they would be executed using cURL.

However, I cannot see a way to execute the same command in KNIME’s GET Request node. Is it possible? I have all the certificates required (three .pem files) but don’t know how to point KNIME to them for this purpose.

FYI, the format of the cURL command is as follows: -

curl --cert signedcertificate.pem – key privatekey.pem --cacert cert.pem https://domain/api/requesttype/parameter

I was not able to do this with native KNIME nodes but, for anyone else who has this issue in future, I was able to do it using KNIME’s ‘R’ integration.

The ‘R’ Package RCurl has syntax that accepts SSL certificates as parameters with getURL requests.

Inside the R to Table node, you can write a script similar to the following: -

library(RCurl)

url <- “https://yourapidomain/request

cafile=“C:/Users/your_user/Documents/R/win-library/3.6/RCurl/CurlSSL/cacert.pem”
certfile=“C:/directory/signedcertificate.pem”
keyfile=“C:/directory/privatekey.pem”

r<-getURL(url,sslcert = certfile, sslkey = keyfile, cainfo = cafile)

knime.out <- as.data.frame® # assign your data frame here

3 Likes

Thanks for posting your solution!

1 Like

You’re welcome! There may be native KNIME solutions as well since others have posted solutions about using SSL with MySQL connectors. But I couldn’t find anything specifically relevant to API requests.

Hi @mrman100,

I’d assume that adding those certs to the keystore file of the used jre should do the trick. Would you mind giving this a try?

Best,
Marten

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.