gpt4 book ai didi

java - Handshaker.algorithmConstraints

转载 作者:行者123 更新时间:2023-11-29 05:00:06 26 4
gpt4 key购买 nike

我正在运行为 HTTP/2 客户端提供的代码 Jetty https://github.com/eclipse/jetty.project/blob/master/jetty-http2/http2-client/src/test/java/org/eclipse/jetty/http2/client/Client.java

我也遇到过这样的问题

INFO::main: Logging initialized @166ms
2015-09-04 22:48:46.253:WARN:oejut.QueuedThreadPool:qtp1342443276-11:
java.lang.IllegalAccessError: tried to access field
sun.security.ssl.Handshaker.algorithmConstraints from class sun.security.ssl.ClientHandshaker
at sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:771)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:281)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:969)
at sun.security.ssl.Handshaker$1.run(Handshaker.java:909)
at sun.security.ssl.Handshaker$1.run(Handshaker.java:906)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1359)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:613)
at org.eclipse.jetty.io.NegotiatingClientConnection.fill(NegotiatingClientConnection.java:96)
at org.eclipse.jetty.io.NegotiatingClientConnection.onFillable(NegotiatingClientConnection.java:82)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:192)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)
2015-09-04 22:48:46.253:WARN:oejut.QueuedThreadPool:qtp1342443276-11: Unexpected thread death: org.eclipse.jetty.util.thread.QueuedThreadPool$3@453be99c in qtp1342443276{STARTED,8<=8<=200,i=6,q=0}
Exception in thread "main" java.util.concurrent.TimeoutException
at org.eclipse.jetty.util.FuturePromise.get(FuturePromise.java:130)
at org.eclipse.jetty.http2.client.Client.main(Client.java:60)

有人知道怎么解决吗?请

最佳答案

To quote @sbordet:来自您关于同一主题的其他问题。

Make sure:

  1. that you have the ALPN boot jar in your bootclasspath;
  2. that the server you are contacting supports HTTP/2;
  3. if using TLS, that the server you are contacting sends a valid, verifiable certificate.

Enable DEBUG logging level for the org.eclipse.jetty category, and you will have a lot of information about what's going on.

Also, set ALPN.debug=true to understand if ALPN worked correctly

简而言之,您需要 ALPN 才能让 HTTP/2 正常工作(这是规范要求)

获得 ALPN 支持的唯一方法是为您的 Java VM 设置 -Xbootclasspath 条目以加载 ALPN 支持 jar(如提到的@sbordet)

关于java - Handshaker.algorithmConstraints,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32401050/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com