Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Should be simple connect to Google News Feed

Solved Go to solution
Highlighted

Should be simple connect to Google News Feed

New 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

Accepted Solutions

Re: Should be simple connect to Google News Feed

New 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

6 REPLIES 6

Re: Should be simple connect to Google News Feed

Expert Contributor

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.

Re: Should be simple connect to Google News Feed

New 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

Re: Should be simple connect to Google News Feed

Expert Contributor

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.

Re: Should be simple connect to Google News Feed

Rising Star

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

Re: Should be simple connect to Google News Feed

New 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

Re: Should be simple connect to Google News Feed

New 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