Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: This function should never be invoked. #1

Closed
reilly3000 opened this issue May 25, 2017 · 4 comments
Closed

WARNING: This function should never be invoked. #1

reilly3000 opened this issue May 25, 2017 · 4 comments

Comments

@reilly3000
Copy link

reilly3000 commented May 25, 2017

After creating a new topic I was trying to play with the new Clojure client. I was typing the code from the example into the repl, so perhaps I made an error, but it looks like an SSL issue

Chriss-MacBook-Pro:pyro chrisreilly$ lein repl
Retrieving org/clojure/clojure/1.9.0-alpha16/clojure-1.9.0-alpha16.pom from central
Retrieving org/clojure/spec.alpha/0.1.94/spec.alpha-0.1.94.pom from central
Retrieving org/clojure/pom.contrib/0.2.2/pom.contrib-0.2.2.pom from central
Retrieving org/clojure/core.specs.alpha/0.1.10/core.specs.alpha-0.1.10.pom from central
Retrieving org/clojure/spec.alpha/0.1.108/spec.alpha-0.1.108.pom from central
Retrieving io/pyroclast/pyroclast-clojure/0.1.0/pyroclast-clojure-0.1.0.pom from clojars
Retrieving cheshire/cheshire/5.7.1/cheshire-5.7.1.pom from clojars
Retrieving com/fasterxml/jackson/core/jackson-core/2.8.6/jackson-core-2.8.6.pom from central
Retrieving com/fasterxml/jackson/jackson-parent/2.8/jackson-parent-2.8.pom from central
Retrieving com/fasterxml/oss-parent/27/oss-parent-27.pom from central
Retrieving com/fasterxml/jackson/dataformat/jackson-dataformat-smile/2.8.6/jackson-dataformat-smile-2.8.6.pom from central
Retrieving com/fasterxml/jackson/dataformat/jackson-dataformats-binary/2.8.6/jackson-dataformats-binary-2.8.6.pom from central
Retrieving com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.8.6/jackson-dataformat-cbor-2.8.6.pom from central
Retrieving clj-http/clj-http/3.5.0/clj-http-3.5.0.pom from clojars
Retrieving org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.pom from central
Retrieving org/apache/httpcomponents/httpcomponents-core/4.4.6/httpcomponents-core-4.4.6.pom from central
Retrieving org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.pom from central
Retrieving org/apache/httpcomponents/httpcomponents-client/4.5.3/httpcomponents-client-4.5.3.pom from central
Retrieving org/apache/httpcomponents/httpasyncclient/4.1.3/httpasyncclient-4.1.3.pom from central
Retrieving org/apache/httpcomponents/httpcomponents-asyncclient/4.1.3/httpcomponents-asyncclient-4.1.3.pom from central
Retrieving org/apache/httpcomponents/httpcore-nio/4.4.6/httpcore-nio-4.4.6.pom from central
Retrieving org/apache/httpcomponents/httpmime/4.5.3/httpmime-4.5.3.pom from central
Retrieving slingshot/slingshot/0.12.2/slingshot-0.12.2.pom from clojars
Retrieving potemkin/potemkin/0.4.3/potemkin-0.4.3.pom from clojars
Retrieving clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.pom from clojars
Retrieving riddley/riddley/0.1.12/riddley-0.1.12.pom from clojars
Retrieving org/clojure/core.specs.alpha/0.1.10/core.specs.alpha-0.1.10.jar from central
Retrieving org/clojure/clojure/1.9.0-alpha16/clojure-1.9.0-alpha16.jar from central
Retrieving org/clojure/spec.alpha/0.1.108/spec.alpha-0.1.108.jar from central
Retrieving com/fasterxml/jackson/dataformat/jackson-dataformat-smile/2.8.6/jackson-dataformat-smile-2.8.6.jar from central
Retrieving com/fasterxml/jackson/core/jackson-core/2.8.6/jackson-core-2.8.6.jar from central
Retrieving com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.8.6/jackson-dataformat-cbor-2.8.6.jar from central
Retrieving org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar from central
Retrieving org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar from central
Retrieving org/apache/httpcomponents/httpasyncclient/4.1.3/httpasyncclient-4.1.3.jar from central
Retrieving org/apache/httpcomponents/httpcore-nio/4.4.6/httpcore-nio-4.4.6.jar from central
Retrieving org/apache/httpcomponents/httpmime/4.5.3/httpmime-4.5.3.jar from central
Retrieving cheshire/cheshire/5.7.1/cheshire-5.7.1.jar from clojars
Retrieving io/pyroclast/pyroclast-clojure/0.1.0/pyroclast-clojure-0.1.0.jar from clojars
Retrieving slingshot/slingshot/0.12.2/slingshot-0.12.2.jar from clojars
Retrieving clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.jar from clojars
Retrieving potemkin/potemkin/0.4.3/potemkin-0.4.3.jar from clojars
Retrieving clj-http/clj-http/3.5.0/clj-http-3.5.0.jar from clojars
Retrieving riddley/riddley/0.1.12/riddley-0.1.12.jar from clojars
nREPL server started on port 55905 on host 127.0.0.1 - nrepl://127.0.0.1:55905
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0-alpha16
Java HotSpot(TM) 64-Bit Server VM 1.8.0_91-b14
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e

user=> (require '[pyroclast-clojure.v1.client :as client])
nil
user=> (def config
#=> {:write-api-key "XXX"
#
=> :endpoint "https://topic.us-east-1.pyroclast.io"
#=> :topic-id "topic-3317c14a-dad4-427d-afeb-7e1d1e1d8f25"
#
=> :format :json})
#'user/config
user=> (client/send-events-async!
#=> config (fn [results] (println results))
#
=> [{:name "Snowflake" :species "Cat" :action "sit" :timestamp 1495072845000}
#_=> {:name "Miles" :species "Human" :action "Sing" :timestamp 1495072855000}])
#object[org.apache.http.impl.nio.client.FutureWrapper 0x13cca5ba "org.apache.http.concurrent.BasicFuture@70affd2f"]
user=> May 24, 2017 9:21:21 PM pyroclast-clojure.v1.client invoke
WARNING: This function should never be invoked. Open an issue on this library if you see this.
javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1431)
at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:535)
at sun.security.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1214)
at sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1186)
at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:469)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doWrap(SSLIOSession.java:266)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:306)
at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:508)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:120)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1728)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:304)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
at sun.security.ssl.Handshaker$1.run(Handshaker.java:919)
at sun.security.ssl.Handshaker$1.run(Handshaker.java:916)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1369)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doRunTask(SSLIOSession.java:284)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:352)
... 9 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:281)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496)
... 17 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
... 23 more

@lbradstreet
Copy link
Contributor

Thanks for the report. I believe this is due to the local certificate store not including the letsencrypt root certificate. We'll discuss a fix and will get back to you.

@MichaelDrogalis
Copy link
Member

Thanks for the report @reilly3000!

As @lbradstreet suspected, it looks like this is due your JDK version not having the root certificate for our provider. LetsEncrypt was included at least after Oracle JDK version 8u101. It was also later added to 7u111.

At the moment, I'm on:

michaels-mbp-4:pyroclast-clojure michael$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

And it seems to work okay. This issue is discussed here also. All you should have to do is upgrade your JDK version. In the mean time, we're going to get another SSL cert so no one else runs into this issue. Sorry for the road bump!

@reilly3000
Copy link
Author

Updating to 8u131 got me running just fine. On my mac my JRE was up to date but my JDK was woefully old...

@lbradstreet
Copy link
Contributor

@reilly3000 great to hear. Thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants