babashka

https://github.com/babashka/babashka. Also see #sci, #nbb and #babashka-circleci-builds .
firstclassfunc 2020-10-28T00:50:12.112500Z

Hello all, not sure this was covered here but using org.httpkit.client with insecure? option still gives me http://javax.net.ssl.SSLHandshakeException.

borkdude 2020-10-28T07:39:57.114200Z

Is this different from the JVM?

borkdude 2020-10-28T10:32:14.114400Z

I.e. can you test on the JVM to see if it works over there. Then we would know if this is an issue with bb + httpkit or httpkit only.

firstclassfunc 2020-10-28T13:42:52.115900Z

tested with http-kit 2.5.0 and jdk 1.8 with no issues.

borkdude 2020-10-28T13:44:12.116100Z

@gary001 babashka uses the SNI client by default. did you also do this?

firstclassfunc 2020-10-28T13:44:48.116300Z

i didn’t let me check

borkdude 2020-10-28T13:48:02.116500Z

You can see the wiring here: https://github.com/borkdude/babashka/blob/master/feature-httpkit-client/babashka/impl/httpkit_client.clj You might be able to get the default client (non SNI) using client/default-client https://github.com/http-kit/http-kit/blob/059deac93b1662077d52e1eb81bef9db8c89d746/src/org/httpkit/client.clj#L97

firstclassfunc 2020-10-28T13:49:45.117100Z

will try sni does seem to take issue with self-signed certs

borkdude 2020-10-28T13:50:33.117300Z

(alter-var-root #'client/*default-client* (constantly client/default-client)) should reset it to the original

borkdude 2020-10-28T13:52:45.117500Z

in bb I mean

firstclassfunc 2020-10-28T13:53:03.117700Z

yep :status 200 thanks so much!!!!

borkdude 2020-10-28T13:53:38.118Z

should we document this?

firstclassfunc 2020-10-28T13:53:58.118200Z

yea i can imagine others will trip over it if using self-signed certs

borkdude 2020-10-28T13:54:40.118400Z

ok, feel free to write an entry here: https://github.com/borkdude/babashka#http

1👍
skuro 2020-10-28T07:22:28.112800Z

has anyone any clue why

(= *file* (System/getProperty "babashka.file")
results into
{:type clojure.lang.ExceptionInfo
   :message No namespace: System found
   :data {:type :sci/error, :line 1, :column 7, :message No namespace: System found, :callstack #object[clojure.lang.Delay 0x1bf465d3 {:status :pending, :val nil}], :file nil, :locals {}}
   :at [sci.impl.utils$rethrow_with_location_of_node invokeStatic utils.cljc 104]}
?

skuro 2020-10-28T07:36:13.112900Z

that's when compiling through CIDER actually, running the script works just fine

borkdude 2020-10-28T07:39:23.113500Z

Which version are you using?

borkdude 2020-10-28T07:39:57.114200Z

Is this different from the JVM?

borkdude 2020-10-28T10:32:14.114400Z

I.e. can you test on the JVM to see if it works over there. Then we would know if this is an issue with bb + httpkit or httpkit only.

2020-10-28T10:39:54.114600Z

@borkdude Nice! I tried using edamame for some code analysis from Babashka, but ran into some issues. Did you try/think about this? Maybe this edamame string parser could be included in the exported functions in babashka?

borkdude 2020-10-28T12:15:28.114700Z

It's still on the list :)

1😅
borkdude 2020-10-28T12:53:34.114900Z

@jeroenvandijk Note that there is also https://github.com/babashka/pod-babashka-parcera now

1👍
2020-10-28T12:54:39.115300Z

Ah cool, yeah that would do it

2020-10-28T12:55:03.115600Z

Thanks!

firstclassfunc 2020-10-28T13:42:52.115900Z

tested with http-kit 2.5.0 and jdk 1.8 with no issues.

borkdude 2020-10-28T13:44:12.116100Z

@gary001 babashka uses the SNI client by default. did you also do this?

firstclassfunc 2020-10-28T13:44:48.116300Z

i didn’t let me check

borkdude 2020-10-28T13:48:02.116500Z

You can see the wiring here: https://github.com/borkdude/babashka/blob/master/feature-httpkit-client/babashka/impl/httpkit_client.clj You might be able to get the default client (non SNI) using client/default-client https://github.com/http-kit/http-kit/blob/059deac93b1662077d52e1eb81bef9db8c89d746/src/org/httpkit/client.clj#L97

firstclassfunc 2020-10-28T13:49:45.117100Z

will try sni does seem to take issue with self-signed certs

borkdude 2020-10-28T13:50:33.117300Z

(alter-var-root #'client/*default-client* (constantly client/default-client)) should reset it to the original

borkdude 2020-10-28T13:52:45.117500Z

in bb I mean

firstclassfunc 2020-10-28T13:53:03.117700Z

yep :status 200 thanks so much!!!!

borkdude 2020-10-28T13:53:38.118Z

should we document this?

firstclassfunc 2020-10-28T13:53:58.118200Z

yea i can imagine others will trip over it if using self-signed certs

borkdude 2020-10-28T13:54:40.118400Z

ok, feel free to write an entry here: https://github.com/borkdude/babashka#http

1👍
lread 2020-10-28T19:24:55.119700Z

Just finished migrating my bb scripts to use babashka/process, went like a charm! Thanks @borkdude!

1💯
borkdude 2020-10-28T19:28:29.119800Z

Thanks for letting me know!