4

I have a NiFi StandardSSLContextService that gives me a custom SSLContext. Now I'm wondering, how to use this in an Groovy (via ExecuteScriptProcessor) httpconnection. I have limited access to the machine, so I can't really install libraries, and have to use, what Nifi and Groovy provide (which should suffice, I hope).

I found no documentation on Groovy's HttpBuilder on http://groovy-lang.org (er...?).

all documentation I found elsewhere seemed pretty bulky (many posts from 2009, 20 lines or more for a simple https connect - I'd have thought, that this has become easier in the last 10 years, especially in groovy).

I'm not sure how to use the HTTPBuilder-ng, since it's documentation does not say, how to use a custom ssl context (not really, the part seems to have been editedt, and something went missing, or I'm mentally stuck in a hole; and I proably can't use it anyways, since I'd have to install it, right?).

So. What, how? This can't be difficult, if I have an sslcontext, I'd expect it to be a one-liner...

Thanks for any help on this!

lepe
  • 24,677
  • 9
  • 99
  • 108
Frischling
  • 2,100
  • 14
  • 34
  • Found something here: https://stackoverflow.com/questions/49578492/programmatically-provide-nifi-invokehttp-different-certificates for me, the @Grab will not work, since my server is not allowed to download stuff from the outside - but others might be able to use it. – Frischling May 30 '18 at 08:19
  • 1
    HttpBuilder also is an external library to groovy / nifi. So, you have to download and put into `nifi/lib` the library you want to work with. – daggett May 30 '18 at 08:50
  • Sadly, I concur. I added an existing jar-file in the modules (/myotherapp/bla/lib/httpclient-4.5.3.jar), then it worked. could you put your statement as an answer? – Frischling May 30 '18 at 12:58

1 Answers1

0

As the suggestion by @dagget already proved to be succesfull, I will place it here as an answer so that the question does not remain open:

HttpBuilder also is an external library to groovy / nifi. So, you have to download and put into nifi/lib the library you want to work with

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122