Created 08-21-2018 04:55 AM
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.
Created on 08-23-2018 04:49 AM - edited 08-17-2019 05:59 PM
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
Created 08-21-2018 11:16 AM
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:
If this answer is helpful, please choose ACCEPT to mark your question answered.
Created on 08-22-2018 05:17 AM - edited 08-17-2019 05:59 PM
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.
Created 08-22-2018 11:21 AM
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.
Created 08-22-2018 05:21 AM
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
Created on 08-22-2018 11:08 PM - edited 08-17-2019 05:59 PM
I added this answer yesterday but not there today. YES and YES I can access newsapi.org via ping from the server for nifi.
Created on 08-23-2018 04:49 AM - edited 08-17-2019 05:59 PM
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