0

I try to execute a simple flow with a MINFI CPP.

For now i create a random number and try to push this to a rest-api with invokehttp

in nifi it works perfectly, but in minifi it gives me the following error:

[class org::apache::nifi::minifi::utils::HTTPClient] [error] curl_easy_perform() failed Unsupported protocol on https://.......

what do i miss? any hints?

thanks

stefan

Stefan S
  • 85
  • 2
  • 9

1 Answers1

0

Could you share what minifi-cpp version you are using? Is it a released binary or did you build it yourself? If you built it yourself, with what options? What platform do you use?

HTTPS support in minifi-cpp depends on how libcURL gets built: it can either be a system dependency, in which case HTTPS support depends on the system's libcURL, or it can be built-in, in which case OpenSSL support must be enabled (not disabled with OPENSSL_OFF and openssl-dev packages installed or the built-in OpenSSL enabled with USE_SYSTEM_OPENSSL=OFF).

The released 0.6.0 versions should support HTTPS on Linuxes, but I recall the Windows build having some problems with it.

mitchken
  • 790
  • 9
  • 26
  • Hi Daniel Thanks for your answer! I took the prebuilt MSI for windows: https://www.apache.org/dyn/closer.lua?path=/nifi/nifi-minifi-cpp/0.6.0/nifi-minifi-cpp-jni-0.6.0.msi And tried to run it on my Win 10 machine. Maybe the prebuilt binaries do not support HTTPS? However i will try with the Windows Linux Subsystem and see if that is working. – Stefan S Oct 03 '19 at 06:14
  • Unfortunately the prebuilt Windows 0.6.0 version does not support HTTPS. This (along with other InvokeHTTP and ListenHTTP issues) was fixed on master: https://github.com/apache/nifi-minifi-cpp/pull/610 If you want to use minifi-cpp natively on Windows, I would suggest using the master for the time being, as there have been many fixes and improvements on the Windows front, and it is easy to build now using the `win_build_vs.bat` provided. There is also a 0.7.0 release on the horizon, including these fixes and improvements, but I don't know an exact date. – Dániel Bakai Oct 03 '19 at 15:06
  • Hi Daniel. After rebuilding it, i get the following error :[error] curl_easy_perform() failed SSL peer certificate or SSH remote key was not OK on https://.... i guess still something is not ok. I did set the System openssl Option in cmake to on. – Stefan S Oct 03 '19 at 19:50
  • Hey. That's actually most likely good news, because it means that you cURL is now compiled with SSL support. This error can occur if either you don't have the CA Certificate set in the SSL Context Service you use for InvokeHTTP, or it is not the proper one. Make sure you supply an SSL Context Service to InvokeHTTP with the proper "CA Certificate" propety set to the CA cert of the particular URL you are trying to fetch, or (but this is obviously not recommended for production), set the "Disable Peer Verification" property of InvokeHTTP to true. – Dániel Bakai Oct 03 '19 at 21:51
  • I am glad it does, feel free to reach out if you hit any more issues! – Dániel Bakai Oct 04 '19 at 07:31
  • Hi Daniel, Sorry to bother you again.Somehow the Expression languages is not working: **name: PutFile class: org.apache.nifi.processors.standard.PutFile max concurrent tasks: 1 scheduling strategy: TIMER_DRIVEN scheduling period: 0 sec penalization period: 30 sec yield period: 1 sec run duration nanos: 0 auto-terminated relationships list: [] Properties: Conflict Resolution Strategy: fail Create Missing Directories: 'true' Directory: C:\TEMP\test\${now():format('Y')}** the Expression is Always returning empty. what am i doing wrong? – Stefan S Oct 06 '19 at 19:02
  • @StefanS Unfortunately date (toDate, format) expressions are not supported on Windows, I have created an issue about it: https://issues.apache.org/jira/browse/MINIFICPP-1054 On an another note (if you want to use minifi-cpp on Linux, or when the Windows version will support it): `format('Y')` is a literal 'Y', to extract the year you have to use `format('%Y')`. – Dániel Bakai Oct 07 '19 at 12:22