Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Should be simple connect to Google News Feed

avatar
Contributor

I have created a aipKey to access newsapi.org I have a simple query https://newsapi.org/v2/everything?q=bitcoin&apiKey=<key>;

I get one of two error using a GetHTTP processor (SSL) Or if I use http:// I get unknownhostexception.

If I use an InvokeHttp processor I just get unknown host. I can curl the request from the server so it is not blocked.

When i set up a standardSSLContextService I am unsure where the certificate path is and what other information is meant to b in this. It all seems a bit of a bother to simply consume a JSON api feed.

1 ACCEPTED SOLUTION

avatar
Contributor

I have solved the problem.

It was simple issue but all new to this and none of the examples online show this fix.

First you need to have a keystore and there is a link above on creating one of those.

Then this is what was missed you need to download the certificate from the site providing the data.

echo -n | openssl s_client -connect newsapi.org:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/examplecert.crt

Then import to your keystore

sudo keytool -import -keystore truststore.jks -file /tmp/examplecer.crt -alias <sitename>

Then set up the Control Service Device for the StandardSSLContextService

86647-capture.png

View solution in original post

6 REPLIES 6

avatar
Super Guru

You are going to have complete the setup of the standardSSLContextService. You can find a writeup about Google HTTPS and using the jvm cacerts for the truststore here:

https://community.hortonworks.com/articles/61180/streaming-ingest-of-google-sheets-into-a-connected....

If this answer is helpful, please choose ACCEPT to mark your question answered.

avatar
Contributor

Thank you @Steven Matison this solved the set up of the standardSSLContextService with the help of This article on setting up the cacerts but I still get a UnknownHostException. Any ideas anyone? Same thing happens on GetHTTP as well.

86630-capture.png

avatar
Super Guru

As mentioned below: you need to verify the nifi host can see that domain and resolve the url. Another thing you might want to do is tail the nifi log while testing and debugging, it often has more helpful information than the red alert box. Once you have the error, search it here in the HCC and make a new question.

avatar
Expert Contributor

are you able to ping the domain newsapi.org from the Nifi host Please confirm that first Use of InvokeHTTP seems correct but somehow that domain name is not resolving

avatar
Contributor

I added this answer yesterday but not there today. YES and YES I can access newsapi.org via ping from the server for nifi.

86646-capture.png

avatar
Contributor

I have solved the problem.

It was simple issue but all new to this and none of the examples online show this fix.

First you need to have a keystore and there is a link above on creating one of those.

Then this is what was missed you need to download the certificate from the site providing the data.

echo -n | openssl s_client -connect newsapi.org:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/examplecert.crt

Then import to your keystore

sudo keytool -import -keystore truststore.jks -file /tmp/examplecer.crt -alias <sitename>

Then set up the Control Service Device for the StandardSSLContextService

86647-capture.png