1

When I am using `slurp' to get the HTML page from "https://clojuredocs.org/clojure.core/slurp", I always get the Exception like:

SSLHandshakeException Received fatal alert: handshake_failure  sun.security.ssl.Alerts.getSSLException (Alerts.java:192) 

But there is no problem when I use the 'wget' download the same page. After doing a comparison of the pcaps, I find the problem might be caused by the cipher suites chosen by the client. When I am using 'slurp', there is 22 cipher suites selected, while the wget selects 66 cipher suites (I can't list all the cipher suites here).

So my question: is there a way to configure the default cipher suites of the JVM to make slurp work with "https://clojuredocs.org"?

xiepan
  • 623
  • 4
  • 13
  • You might want to look at https://stackoverflow.com/questions/34136168/force-jvm-to-use-certain-cipher-for-https-connections – Juraj Martinka Jun 26 '18 at 16:58

1 Answers1

0

You probably want to solve this on the JVM level. For example on my machine it just works:

(subs (slurp "https://clojuredocs.org") 0 10)
"<!DOCTYPE "

I tried this both with IBM Java:

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 8.0.5.11 - pxa6480sr5fp11-20180326_01(SR5 FP11))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64 Compressed References 20180309_380776 (JIT enabled, AOT enabled)

and Oracle Java:

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

Sounds to me like you need a recent Java version and everything will be fine. Which version are you using?

Stefan Kamphausen
  • 1,615
  • 15
  • 20